-
Notifications
You must be signed in to change notification settings - Fork 46
nOSConfig
File used to configure kernel and reduce memory footprint when not all features are required. A template is available in nOS/inc/nOSConfig_TEMPLATE.h for your convenience. Just copy the template with your other header files, rename it to nOSConfig.h and edit it to your needs.
Enable or disable debug code. Initialize thread's registers and stack to known values (useful to know how much space of the stack is used by the thread).
Notes:
- Can be disabled when application will be debugged to decrease flash space used.
Enable or disable arguments checking in nOS API (useful for application development).
Notes:
- Can be disabled when application will be debugged to increase performance and decrease flash space used.
- Before disabling this option, ensure your application is not doing anything againts the rules by checking error code.
Highest priority a thread can have (0 to 255 inclusively). Set to 0 to enable a cooperative scheduling with all threads at the same priority (preemptive scheduling need to be disabled).
0 = Lowest priority
255 = Highest priority
Notes:
- It is recommenced to set NOS_CONFIG_HIGHEST_THREAD_PRIO adjusted to the minimum required by the application to minimize memory used by the scheduler.
Size of ticks counter for sleep/timeout in bits (can be 8, 16, 32 or 64).
Notes:
- Bits width directly affects the maximum timeout that the application can specify to nOS API.
- For maximum performance, it is recommenced to set width of a CPU register.
Number of ticks per second. nOS_MsToTicks and nOS_SleepMs use this value to convert ms to ticks.
Notes:
- It is recommended to don't set value higher than 1000 ticks per second.
- For Unix and Win32 simulator, this value can't be set to value higher than 100 ticks per second.
Enable or disable preemptive scheduler. When enabled, the scheduler will ensure it's always the thread with the highest priority that is ready to run that is running. If disabled, the running thread must relinquish the CPU when it allow other threads to run (cooperative scheduling) (round robin scheduling should be disabled).
Notes:
- Need to be disabled if NOS_CONFIG_HIGHEST_THREAD_PRIO is set to 0.
Enable or disable round-robin scheduler. If enabled, each tick will try to switch context to another thread of the same priority that is ready to run.
Notes:
- Need to be disabled if NOS_CONFIG_SCHED_PREEMPTIVE_ENABLE is disabled when NOS_CONFIG_HIGHEST_THREAD_PRIO is higher than 0.