Arduino Nil RTOS library.
| #define NIL_RTOS_VERSION 20140816 |
| #define nilSemFastSignalI |
( |
|
sp | ) |
((sp)->cnt++) |
Increases the semaphore counter.
This macro can be used when the counter is known to be not negative.
| #define nilSemFastWaitI |
( |
|
sp | ) |
((sp)->cnt--) |
Decreases the semaphore counter.
This macro can be used when the counter is known to be positive.
| #define nilSemGetCounterI |
( |
|
sp | ) |
((sp)->cnt) |
Returns the semaphore counter current value.
Delays the invoking thread for the specified number of milliseconds.
- Note
- This function does not sleep and will block all lower priority threads. This function should only be used in the idle thread.
-
The specified time is rounded up to a value allowed by the real system clock.
-
The maximum specified value is implementation dependent.
- Parameters
-
| [in] | msec | time in milliseconds, must be different from zero |
| #define SEMAPHORE_DECL |
( |
|
name, |
|
|
|
n |
|
) |
| semaphore_t name = {n} |
Static semaphore initializer.
Statically initialized semaphores require no explicit initialization using nilSemInit().
- Parameters
-
| [in] | name | the name of the semaphore variable |
| [in] | n | the counter initial value, this value must be non-negative |
Board-specific initialization code for Arduino. Use timer 0 compare A to geneate an interrupt every 1024 usec.
| static void nilFillStacks |
( |
| ) |
|
|
static |
| void nilPrintStackSizes |
( |
Print * |
pr | ) |
|
Print size of all all stacks.
- Parameters
-
| [in] | pr | Print stream for output. |
| void nilPrintUnusedStack |
( |
Print * |
pr | ) |
|
Print unused byte count for all stacks.
- Parameters
-
| [in] | pr | Print stream for output. |
Returns the semaphore counter current value.
- Parameters
-
| [in] | sp | pointer to a Semaphore structure. |
- Returns
- the value of the semaphore counter.
Start Nil RTOS with all stack memory initialized to a known value.
- Returns
- TRUE for success else FALSE.
| bool nilSysBeginNoFill |
( |
| ) |
|
Start Nil RTOS with raw uninitialized stack memory. This call saves a little flash compared to nilSysBegin().
- Returns
- TRUE for success else FALSE.
Delay the invoking thread for the specified time.
- Parameters
-
| [in] | time | the delay in system ticks. |
- Note
- This function does not sleep and will block all lower priority threads. This function should only be used in the idle thread.
Delay the invoking thread until the system time reaches to the specified value.
- Parameters
-
| [in] | time | absolute system time |
- Note
- This function does not sleep and will block all lower priority threads. This function should only be used in the idle thread.
| size_t nilUnusedHeapIdle |
( |
| ) |
|
Determine unused bytes in the heap and idle yhread stack area.
- Returns
- Number of unused bytes.
| size_t nilUnusedStack |
( |
uint8_t |
nt | ) |
|
Determine unused stack for a thread.
- Parameters
-
- Returns
- Number of unused stack bytes.