Home News Features Examples Code FAQ License
AVR Webring
Prev Hub Join Rate Next
Application Programming Interface
0.92 0.91 0.89 0.88 0.87

Introduction

Below, find an overview of the methodes you can use in your code. This list is only valid for version 0.92 of Femto OS. Please select the correct version first, for names, codes and descriptions made be significantly different between the versions.

Please have a look inside the file femtoos_core.h for a more elaborate discussion about the use. Methodes starting with 'gen' can be used from within a task, isr or code running in OS space. Methods with the prefix 'task' should only be called from task, and may trigger a switch of context. Some methodes have a twin "onName" method, these are not seperately listed.

The hexadecimal code of the call is the method identifier code returned by the error callback when an error arises after calling the method.

Methods related to task control.
genGetPriority Return the current priority of a given task. 0x36
genGetLastWakeTime Return the time the task was last woken. 0x38
genGetTaskname Get the flash address of the task name 0x39
genResume Resume the given task from suspension. 0x34
genSetPriority Set a new priority for the given task. 0x35
genSuspend Suspend a task, but do not invoke a context switch. 0x33
taskDelayFromNow Delay the task a number of ticks, starting from now. 0x03
taskDelayFromWake Delay the task a number of ticks, starting at the last wake time. 0x04
taskFeedWatchdog Feed the watchdog in order to prevent barking. 0x09
taskKillWatchdog Switch off the watchdog facility for this task. 0x0A
taskTerminate Stop (in error mode) one particular task. 0x0C
taskSuspend Suspend this task and invoke a context switch. 0x05
taskRecreate Recreate one particular task. 0x08
taskRestart Restart the running task. 0x0B
taskSleep Put the current task to sleep and invoke a context switch. 0x06
taskSleepAll Put all tasks to sleep. 0x07
taskStackCheck Call to check how much free space is left on the task stack. ----
taskYield Manual context switch 0x01

Methods related to OS control.
genAddtoTickCount Add the given number of ticks to the tick counter. 0x47
genGetTickCount Get the tick counter. 0x37
genLogOs Binary one liner about the os 0x3D
genLogTask Binary one liners about every task 0x3C
genPassFlashString Auxiliary function to push a string on a pipe 0x48
genPipeInt16 Auxiliary function to push a Tint16 on a pipe ----
genReboot Reboot the system 0x3B
genTraceByteInfo Custom trace facility, sends one byte over the traceline. ----
genTraceWordInfo Custom trace facility, sends one byte over the traceline. ----
genTraceMarker Custom trace facility, sends a marker traceline. ----

Methods related to synchronization.
genQueuClear Clear the queue. 0x46
genQueuEmpty See if the queue is empty. 0x45
genQueuFull See if the queue is full. 0x44
genQueuPeek Look ahead what the next byte to read would be. 0x41
genQueuWrite Write a byte on the queue. 0x3F
genQueuUnwrite Unwrite (remove) bytes from the queue. 0x4A
genQueuWriteable See how many bytes can be written to the queue. 0x43
genQueuRead Read a byte from the queue. 0x40
genQueuUnread Unread (remove) bytes from the queue. 0x4B
genQueuReadable See how many bytes can be read from the queue. 0x42
genWaitRelease Release all wait locks on this slot. 0x3E
taskMutexRequestOnName Call to take possession of a mutex on name. 0x27
taskMutexReleaseOnName Release the lock on a mutex, by name 0x27
taskQueuRequestOnName Call to take possession of a queue on name. 0x27
taskQueuWriteRequestOnName Call to take possession of a queue on name. 0x27
taskQueuReadRequestOnName Call to take possession of a queue on name. 0x27
taskQueuReleaseOnName Release the lock on a queue, by name 0x28
taskSyncRequest Try to obtain a lock on a queue , on a mutex or both. 0x27
taskSyncRelease Release a queue, on a mutex or both. 0x28
taskSyncReleaseOnName Release the lock on a queue or mutex, by name. 0x28
taskSyncWriteWriteRequestOnName Call to take possession of a queue, mutex or both. 0x27
taskSyncWriteReadRequestOnName Call to take possession of a queue, mutex or both. 0x27
taskSyncReadWriteRequestOnName Call to take possession of a queue, mutex or both. 0x27
taskSyncReadReadRequestOnName Call to take possession of a queue, mutex or both. 0x27
taskWaitForOtherTask Lock this task until an other tasks pass on the same slot. 0x26
taskWaitForTasks Lock this task until n other tasks pass on the same slot. 0x26

Methods related to interrupts.
isrBegin Start the isr, switch to the isr stack. ----
isrEndReturn Stop the isr, return to the place where the interrupt occurred. ----
isrEndYield Stop the isr, yield as quickly as possible ----
isrEnter Start the isr by a context switch. ----
isrExit End the isr, switch to the OS. ----
isrStackCheck Call to check how much free space is left on the isr stack. ----
isrStartLoad Start measuring the time spend in an isr. ----
isrStopLoad Stop measuring the time spend in an isr. ----
taskEnableGlobalInterrupts Enable global interrupts, trace when needed 0x0D
taskDisableGlobalInterrupts Disable global interrupts, trace when needed 0x0E
taskEnterGlobalCritical Enter global critical section 0x13
taskExitGlobalCritical Exit global critical section 0x14
taskEnableSwitchTask Enable task switching. 0x11
taskDisableSwitchTask Disable task switching. 0x12
taskEnterSwitchCritical Enter task switch critical section 0x17
taskExitSwitchCritical Exit task switch critical section 0x18
taskEnableTickInterrupts Enable Tick interrupts, trace when needed 0x0F
taskDisableTickInterrupts Disable Tick interrupts, trace when needed 0x10
taskEnterTickCritical Enter Tick critical section 0x15
taskExitTickCritical Exit Tick critical section 0x16

Methods related to events.
isrFireEvent Call this to fire an event from the isr. ----
genFireEvent Call this to fire an event from any place. ----
genFireEventSet Call this to release tasks waiting for an different events. 0x3A
genCountEventBlocks Call to get the number of blocks on a combination of events. 0x49
taskWaitForEvent Call to let the task wait for one specific event in the system. 0x02
taskWaitForEventSet Call to let the task wait for more specific events in the system. 0x02

Methods related to the file system.
taskFileAppendByte Add one byte to the file, starting at the beginning when full. 0x20
taskFileClear Clear the file by setting its size to zero, contents are unchanged. 0x1D
taskFileClose Close the file system, so other tasks may obtain access. 0x1A
taskFileDirectRead Direct read function on the file system. ----
taskFileDirectWrite Direct write function on the file system. ----
taskFileFormat Clean (fill with zero's) the whole disk space. 0x1B
taskFileGetSize Get the present size of a file. 0x1C
taskFileOpen Open the file system for writing and/or reading. 0x19
taskFileReadBuffer Read several bytes from the file and push them to the buffer. 0x23
taskFileReadByte Get one byte from a file using a raw read. 0x1E
taskFileReadPipe Read several bytes from the file and push them to the pipe. 0x21
taskFileSetSize Give the file a new size, contents are unchanged. 0x1D
taskFileWriteBuffer Read several bytes from the buffer and put the on file. 0x24
taskFileWriteByte Write one byte to a file using a raw write. 0x1F
taskFileWritePipe Read several bytes from the pipe and put the on file. 0x22

Preprocessor constants
defAllEvents Literal value to fire all events in the genFireEventSet method.
defCurrentTaskName Literal value to specify the current task.
defCurrentTaskNumber Value to specify the current task.
defFromFileEnd Literal value to state to start at the end of a file.
defFromFileStart Literal value to state to start at the beginning of a file.
defLockBlockInfinite Use in a synchronizing method to specify it may not timeout
defLockDoNotBlock Use in a synchronizing method to say it must return immediately
defDelayTimeMax The highest delay time you may use.
defDelayTimeZero The lowest delay time you may use.
defReadOnly Literal value to state to open the file system in read only mode.
defReadWrite Literal value to state to open the file system in read/write mode.
defStackInitByte Value with which the stack is filled.
defUntilFileEnd Literal value to state you want to run up to the end of a file.

Preprocessor functions
preBitClr Use this function as general method to clear bits.
preEventNumberOf Returns the number of an event named "EventName".
preEqualMacros Use to check if two macro's are equal.
preFileDefined Use this function to see if a file is defined on a file name.
preFileNumberOf Returns the file number of a file with the name "FileName".
preBitIsClr Test if a bit on a particular place is cleared.
preBitIsSet Test if a bit on a particular place is set.
preMutexDefined Use to see if a mutex is defined on a slot name.
preQueuDefined Use to see if a queu is defined on a slot name.
preBitSet Use this function as general bit setter.
preSlotDefined Use to see if a slot is in use.
preSlotNumberOf Returns the slot number of a slot with the name "SlotName".
preTaskDefined Use to see if a task is defined and included in the source
preTaskNumberOf Returns the task number of a task with the name "TaskName".
preWaitDefined Use this function to see if a wait is defined on a slot name.
defRestartSuspended Literal value to restart a task in the suspended state.
defRestartSleeping Literal value to restart a task in the sleeping state.
defRestartDefault Literal value to restart a task in the default state.
defRestartRunning Literal value to restart a task in the running state.
defSuspendNow Literal value to suspend a task directly
defSuspendCheck Literal value to check for a suspend request.
defSuspendClear Literal value to reset a suspend request and continue.

Detailed descriptions

0x36 genGetPriority: Return the current priority of a given task.
Tuint08 genGetPriority(Tuint08 uiTaskNumber)
Tuint08 genGetPriorityOnName(Tlit TaskName)
Call this to retrieve the current priority of a task.Of course the information may be outdated the moment it is received. Returns a value between 0 and 7, boundary values included.

0x38 genGetLastWakeTime: Return the time the task was last woken.
Tuint16 genGetLastWakeTime(Tuint08 uiTaskNumber)
Tuint16 genGetLastWakeTimeOnName(Tlit TaskName)
When you want to know what the last time was a task was woken call this function. If it was last woken from a delay this time is always correct, otherwise activate the cfgUseCorrectWakeupTimes option. When activated, other wakeup events are recorded as well.

0x39 genGetTaskname: Get the flash address of the task name
Taddress genGetTaskname(Tuint08 uiTaskNumber)
Taddress genGetTasknameOnName(Tlit TaskName)
Call this method to get the address of the task name of the given task Note that it returns an address in flash, so take appropriate measures read the data, for example read the bytes using portFlashReadByte().

0x34 genResume: Resume the given task from suspension.
void genResume(Tuint08 uiTaskNumber)
void genResumeOnName(Tlit TaskName)
A suspended task can be resumed by this call. A task that is in an other state (running (go), terminated, sleeping) remain unchanged. So there is no harm in calling this method on such tasks.
     Any standing suspend requests are cleared. So you can be certain that the task will not be suspend as a result of prior genSuspend() calls.

0x35 genSetPriority: Set a new priority for the given task.
void genSetPriority(Tuint08 uiTaskNumber, Tuint08 uiNewPriority)
void genSetPriorityOnName(Tlit TaskName, Tuint08 NewPriority)
All task run in the initial priority. There are eight priorities running from 0 to 7, 0 being the lowest. The idle task runs in fictive priority -1, thus being the lowest of all. The priority can be raised or lowered at will.

0x33 genSuspend: Suspend a task, but do not invoke a context switch.
void genSuspend(Tuint08 uiTaskNumber)
void genSuspendOnName(Tlit TaskName)
Call this method if you want to suspend a particular task. The state of that task is not changed to suspended immediately, but this is viewed as a suspend request, to which the task may respond if he likes, by calling taskSuspend(defSuspendCheck). The reason the call does not have immediate effect is that the current state of the target task is unclear. It may be blocking or holding locks or have open files. Suspending such tasks may take down the whole system. If the task is restarted however the state is well defined (it may not hold locks of blocks) the request is always honored, independent of the parameter restart was called with. The latter also implies that this call may used in the bark method of a task, in order to stop the task until the cause of the timeout problems have been eliminated.
     The call does not force a context switch, thus if you call it with the current running task number the method returns.
     The call has no effect on terminated or already suspended tasks. Sleeping tasks will receive the request and be suspended when they handle the call after they have waken.
     When called upon shared tasks, the result depends on the state of the shared task. If it is currently scheduled for execution, if will be treated as a normal task. So if it runs into a taskSuspend(defSuspendCheck) it will be suspended immediately, and no other shared tasks are able to run again. If the shared task hits restart first, the task will be suspended in shared state, thus allowing the other shared states to run. In general it is inadvisable to have a taskSuspend() in a shared task.

0x03 taskDelayFromNow: Delay the task a number of ticks, starting from now.
void taskDelayFromNow(Tuint16 uiTicksToWait)
taskDelayFromNow delays your task for the given number of ticks. This value represents the minimum delay. Since the delay time is measured from the moment the delay call is issued, it cannot be used to obtain a reliable frequency. The value uiTicksToWait may vary from defDelayTimeZero (0, included) up to defDelayTimeMax (0xFEFF, included).

0x04 taskDelayFromWake: Delay the task a number of ticks, starting at the last wake time.
void taskDelayFromWake(Tuint16 uiTicksToWait)
taskDelayFromWake delays your task for the given number of ticks. The delay time is measured from the moment of last wakeup. This is automatically correct when the tasks are only stopped by delays. If however you want it to be correct in case of suspended and locked tasks as well, set cfgUseCorrectWakeupTimes to true. It can be used to obtain a reliable frequency, within the limits of the system clock and demands of other tasks. The value uiTicksToWait may vary from defDelayTimeZero (0, included) up to defDelayTimeMax (0xFEFF, included).

0x09 taskFeedWatchdog: Feed the watchdog in order to prevent barking.
void taskFeedWatchdog(void)
If you activated cfgUseTaskWatchdog and fed the watchdog at least once, it is on alert. Each task has its own watchdog. After a certain time (configurable with cfgNumWatchdogDiv) it starts barking, which means it calls your bark routine if specified and subsequently restarts the task, by re-intializing the context and calling your loop code. To prevent the watchdog from barking, call taskFeedWatchdog() regularly from you code. If you want to stop its activity call taskKillWatchdog(). Please note that every loop starts with de-activated watchdog, the watchdog is activated after the first taskFeedWatchdog(). If a task got stuck and is restarted, the watchdog is de-activated! Make sure you activate it early in your code.

0x0A taskKillWatchdog: Switch off the watchdog facility for this task.
void taskKillWatchdog(void)
See also taskFeedWatchdog(). A watchdog once activated must or be fed or be killed in order to keep it quit. You can call taskKillWatchdog on a already dead watchdog.

0x0C taskTerminate: Stop (in error mode) one particular task.
void taskTerminate(Tuint08 uiTaskNumber)
void taskTerminateOnName(Tlit TaskName)
Call this function if you want to stop a task permanently. The task is terminated and cannot be revived by resume or so. In case you have some checking activated, and the system detects an error, the task is brought to the same state. A terminated task can be recreated, provided you compiled the necessary code in. See taskCreate() for more information.

0x05 taskSuspend: Suspend this task and invoke a context switch.
void taskSuspend(Tuint08 uiSuspendMode)
If you need to suspend your task immediately call this method with the parameter defSuspendNow. If you want to handle a suspend request from genSuspend(), call with defSuspendCheck. The suspended state is directly applied, a context switch is performed. This method only returns if an other task (or isr) calls genResume on your task.
     If you want to remove any suspend requests, call it with defSuspendClear. The task will not suspend and the request will be deleted.
     Do not use this at places where you may hold resources, such are files, or locks. Although possible, other tasks may be effectively blocked as well. Or know what you are doing. It is an error to call it in the dominant mode, since it will render the switch protection of that mode useless.

0x08 taskRecreate: Recreate one particular task.
void taskRecreate(Tuint08 uiTaskNumber)
void taskRecreateOnName(Tlit TaskName)
Recreate a task by recreating its context. appInit() if present is called again, for (hardware) (re)initialization. The context is cleared, locks are released, and the appLoop() is called, as if the task is new. Your (private) static variables are not cleaned or changed. The task may be terminated, running or in whatever state. You may even call it on you own task, in which case this call does not return.

0x0B taskRestart: Restart the running task.
void taskRestart(Tuint08 uiRestartMode, Tuint16 uiTicksToWait))
Restart the task currently running. If present the watchdog is killed and the context is cleared. Subsequently appLoop() is called. appInit() is not called again, this is for one time (hardware) initialization. Watermarks are not cleared. Locks are not released and the priority is kept. Holding a lock at the moment of this call is an error. You can supply a delay, which means that the task is restarted not earlier as the given delay. This call does not return. Your (private) static variables are not cleaned or changed.

0x06 taskSleep: Put the current task to sleep and invoke a context switch.
void taskSleep(void)
Call this if you want to put the current task into low power sleep. A sleeping task is not rescheduled for operation, and cannot be woken by the user anymore (it can be recreated though). If all tasks are in sleep state, or some delays are sufficiently long, the device may go to low power sleep, see the options for details. Note that there is no call to put an other specific task to sleep. The method returns when the sleep has taken place. Never call sleep when you have a write lock on the file system, and it is unwise to call it when you hold a read lock (since it will prevent other tasks from writing). Thus call sleep after you have completed file operations (i.e. after fileClose)
     It is possible to put yourself to sleep in the dominant mode. Although the dominant mode is remembered and revived after the sleep, during sleep other tasks will be activated, which may, request for a dominant mode themselves. This may lead to an unclear situation at wake up.
     Shared tasks can be put to sleep with this call, but after sleep the call does not return, but the task is restarted in the running mode instead. During sleep of the task, other shared tasks are rescheduled, when present. Because this call works as a restart for shared tasks you are not allowed to call it with any locks.

0x07 taskSleepAll: Put all tasks to sleep.
void taskSleepAll(void)
Call this is you want give the OS the possibility to go to low power sleep directly. It puts all tasks into low power sleep, which should normally trigger the sleep mode. If any task is using the file system, or is blocking to get access, Femto OS waits until all file write operations have come to an end, and puts the system to sleep directly after. Tasks not using the FS at the moment of calling are put so sleep immediately. The current task may make use of the FS and is treated like other tasks. Thus if the task is in read only mode it will sleep directly; if the task is in read/write mode it will do so at taskFileClose(). See also the discussion on taskSleep(). The method returns when the sleep has taken place.

---- taskStackCheck: Call to check how much free space is left on the task stack.
Tuint08 taskStackCheck(Tuint08 uiExtraStackSafety)
With this function you can check on any place in your code what would happen if a context switch was made here. This function only works when cfgCheckTaskStack set to cfgTrue. Otherwise the function is still defined, but returns 0, so that it does need to be removed every time you switch the cfgCheckTaskStack setting. With the parameter uiExtraStackSafety you can supply how much extra space you require at this place. Use this to compensate for extra stack in calls in which you cannot place this function. The uiExtraStackSafety comes onto the normal StackSafety parameter. Thus the larger the uiExtraStackSafety the quicker an (expected) error occurs.
     This function returns the amount of free (real) stack space at the moment of calling, that would be left over, if an context save would happen right at this place, apart from the safety parameters, but the stack required for this call included. Thus, if it returns 0 you are living on the edge. This function also operates correctly if the stack level and uiExtraStackSafety together exceed the 255 byte limit.

0x01 taskYield: Manual context switch
void taskYield(void)
Call this function inside your code when you want to force a context switch. Note it makes no real sense to call it if you are the task with the highest priority for it will immediately return. Mostly you use this call as some kind of cooperative escape from part of your code where interrupts are disabled.

0x47 genAddtoTickCount: Add the given number of ticks to the tick counter.
void genAddtoTickCount(Tuint16 uiSleepTime)
With this function it is possible to add some value to the tick counter, which is shifted to the future. All missed appTick00() and appTick08() calls are NOT catched up. However an appTick16() call is performed should the tick counter roll over. This method is typically used in situations where the processor is put into a low power sleep.

0x37 genGetTickCount: Get the tick counter.
Tuint16 genGetTickCount(void)
Returns the current value of the tick counter. The tick counter is a 16 bit value running from 0 to 0xFFFF. If the tick interrupts come every millisecond we have a timer of approximately 65 seconds.

0x3D genLogOs: Binary one liner about the os
void genLogOs(void (*pipe)(Tchar))
Call this function to obtain information about the OS itself The information is piped through the given pipe method, which could be a write method on a queue, so there is no need for a separate buffer. The information is in binary form, of the following form: Id(1) StatusOs(1) LoadOs(2) LoadIdle(2) LoadIsr(2) StackOsMax(1) StackIsrMax(2) the number indicating the number of bytes to be expected.

0x3C genLogTask: Binary one liners about every task
void genLogTask(Tuint08 uiTaskNumber, void (*pipe)(Tchar))
Call this function to obtain information about the a task in the OS. The information is piped through the given pipe method, which could be a write method on a queue, so there is no need for a separate buffer. The information is in binary form, of the following form: Id(1) TaskNr(1) Status(1) LoadOs/0(2) Name(8) TaskMonitor(1) TaskLevels(1) SlotStack(4) StackMax(2) RegUse(1) the number indicating the number of bytes to be expected.

0x48 genPassFlashString: Auxiliary function to push a string on a pipe
void genPassFlashString(Taddress pString, Tuint08 uiLength, Tchar cFilling, void (*pipe)(Tchar))
Inside genLogOs and genLogTask use is made of the function to pipe a string from flash. When uiLength == 0 this method continues and scans the string for a terminating null character. If uiLength > 0 the number of chars is exactly uiLength. If the real length of the string is shorter it is augmented with cFilling chars, otherwise the string is just truncated. The terminating null character is never copied. Note that this function when used externally uses excessive amount of stack so that is may be more efficient to just duplicate the code and inline it.

---- genPipeInt16: Auxiliary function to push a Tint16 on a pipe
void genPipeInt16(Tuint16 uiValue, void (*pipe)(Tchar))
Inside genLogOs and genLogTask use is made of the function to pipe a 16 bit number. It is available for the user also. Note that this function when used externally uses excessive amount of stack so that is may be more efficient to just duplicate the code and inline it.

0x3B genReboot: Reboot the system
void genReboot(void)
This call reboots, but not necessarily resets, the system. The actual result depends on the contents of portReboot(), but on the my avr it simply calls reset, which does not imply a full hardware reset. The software is fully reset though, inclusive cleaning of all variables. As this function may be called from an interrupt it may be used to reactivate a dead system. An other use is a call in a shell. Normally however, there is not much need for such a function. This function should not return.

---- genTraceByteInfo: Custom trace facility, sends one byte over the traceline.
void genTraceByteInfo(Tbyte bUser)
You can make use of the trace facility yourself by using this routine. It puts out one payload byte after the eventUserByteMessage trace message. If cfgCheckTrace == cfgFalse it is replaced by an empty statement. Include with

---- genTraceWordInfo: Custom trace facility, sends one byte over the traceline.
void genTraceWordInfo(Tword bUser)
You can make use of the trace facility yourself by using this routine. It puts out one payload byte after the eventUserByteMessage trace message. If cfgCheckTrace == cfgFalse it is replaced by an empty statement. Include with

---- genTraceMarker: Custom trace facility, sends a marker traceline.
void genTraceMarker()
You can make use of the trace facility yourself by using this routine. Use the marker to start tracing a some later point. In the trace program you can specify how many markers must have passed before the tracing starts. If cfgCheckTrace == cfgFalse it is replaced by an empty statement.

0x46 genQueuClear: Clear the queue.
void genQueuClear(Tuint08 uiSlot)
void genQueuClearOnName(Tlit SlotName)
Call this to clear the queue. The remaining bytes are not removed, but the read and write pointers are simply reset. Be careful with clearing queues with write blocks on it, for those tasks may block indefinitely (if no timeout has been specified), even if cleaning means that room has become available to write some bytes.

0x45 genQueuEmpty: See if the queue is empty.
Tbool genQueuEmpty(Tuint08 uiSlot)
Tbool genQueuEmptyOnName(Tlit SlotName)
A quick method to see if the queue is empty. Interrupts are blocked only shortly inside.

0x44 genQueuFull: See if the queue is full.
Tbool genQueuFull(Tuint08 uiSlot)
Tbool genQueuFullOnName(Tlit SlotName)
A quick method to see if the queue is full. Interrupts are not blocked inside since the information is obtained in a single atomic read operation.

0x41 genQueuPeek: Look ahead what the next byte to read would be.
Tbyte genQueuPeek(Tuint08 uiSlot)
Tbyte genQueuPeekOnName(Tlit SlotName)
Instead of reading the byte from the queue, sometimes you want to know which byte is coming without removing that byte. Call this method to peek into the queue. If the queue is empty, it returns 0.

0x3F genQueuWrite: Write a byte on the queue.
void genQueuWrite(Tuint08 uiSlot, Tbyte bItem)
void genQueuWriteOnName(Tlit SlotName, Tbyte bItem)
Call this method if you want to write one byte to the queue. The execution takes place in task space, and may require some stackspace. Before you write a byte please first obtain a lock on the queue, or be sure you are the only one writing/reading (in an isr you cannot obtain a lock). The read/write methods are tick/interrupt protected. Thus it is possible to use the queue mechanism without the request/release methods, if you take care of locking and counting of the bytes yourself. This is particularly handy when working with interrupts A queue may filled in the interrupt and read in a task. If you write on a full queue the new bytes are disposed and not placed on the queue.

0x4A genQueuUnwrite: Unwrite (remove) bytes from the queue.
void genQueuUnwrite(Tuint08 uiSlot, Tuint08 uiUnwriteSize)
void genQueuUnwriteOnName(Tlit SlotName, Tuint08 uiUnwriteSize)
Call this method if you want to undo the last write operations. The execution takes place in task space, and may require some stack space. Normally you use this directly after several genQueuWrite(), thus inside the same locked environment, to correct erroneous write operations. If done outside the lock, be sure you know what bytes you are removing. You may try to unwrite more bytes as present, this is not an error, and will result all the removal of all bytes written.
     Note that this action does not restore the original values (from before the write) of the queue. So if this call is followed by an genQueuUnread(), those bytes will not magically return.
     Typical use is after a communication when it turns out for example that the crc of the bytes received is incorrect.

0x43 genQueuWriteable: See how many bytes can be written to the queue.
Tuint08 genQueuWriteable(Tuint08 uiSlot)
Tuint08 genQueuWriteableOnName(Tlit SlotName)
This method return how may bytes can be written to the queue. This is really a temporarily value, but since you know which tasks read/write on the queue, you can judge how stable it is.

0x40 genQueuRead: Read a byte from the queue.
Tbyte genQueuRead(Tuint08 uiSlot)
Tbyte genQueuReadOnName(Tlit SlotName)
Call this method if you want to read one byte from the queue. The execution takes place in task space, and may require some stack space. Before you write a byte please first obtain a lock on the queue, or be sure you are the only one writing/reading (in an isr you cannot obtain a lock). The read/write methods are tick/interrupt protected. Thus it is possible to use the queue mechanism without the request/release methods, if you take care of locking and counting of the bytes yourself. This is particularly handy when working with interrupts. A queue may filled in the interrupt and read in a task. If you read from an empty queue the returned value is 0.

0x4B genQueuUnread: Unread (remove) bytes from the queue.
void genQueuUnread(Tuint08 uiSlot, Tuint08 uiUnreadSize)
void genQueuUnreadOnName(Tlit SlotName, Tuint08 uiUnreadSize)
Call this method if you want to undo the last read operations. The execution takes place in task space, and may require some stack space. Normally you use this directly after several genQueuRead(), thus inside the same locked environment, to correct erroneous read operations. If done outside the lock, be sure you know what bytes you are removing. You may try to unread more bytes as present, this is not an error, and will result all the removal of all bytes read.
     After an unread the bytes my be read again, and since the values in the queue are not altered, the same values will reappear.
     Typical use is after a communication when it turns out for example that the crc of the bytes received is incorrect.

0x42 genQueuReadable: See how many bytes can be read from the queue.
Tuint08 genQueuReadable(Tuint08 uiSlot)
Tuint08 genQueuReadableOnName(Tlit SlotName)
This method return how may bytes can be read to the queue. This is really a temporarily value, but since you know which tasks read/write on the queue, you can judge how stable it is.

0x3E genWaitRelease: Release all wait locks on this slot.
void genWaitRelease(Tuint08 uiSlot)
void genWaitReleaseOnName(Tlit SlotName)
Use this call to release a rendezvous started with taskWaitForTasks() or taskWaitForOtherTask(). All waiting tasks are released and return true when cfgUseTimeout is activated. Note this method can be called from within an isr. On other specialty is that this call may also be performed from tasks not holding slots by themselves.

0x27 taskMutexRequestOnName: Call to take possession of a mutex on name.
Tbool taskMutexRequestOnName(Tlit SlotName, Tuint16 uiTicksToWait)
Tbool taskMutexRequestOnName(Tlit SlotName)
Call this if you want to take possession of a mutex. Use the (literal) slot name. The task blocks until the mutex is available.
     You must specify a timeout, if cfgUseTimeout is activated. You can specify anything from 2 to defDelayTimeMax. If you need an infinite wait, specify defLockBlockInfinite, and if you want an immediate return specify defLockDoNotBlock, to make your intentions clear. The method returns true or false. True means that the lock has been obtained, false means a timeout.

0x27 taskMutexReleaseOnName: Release the lock on a mutex, by name
void taskMutexReleaseOnName(Tlit SlotName)
These macro make it possible to release a lock on a mutex on the basis of the name. It performs the same action as taskSyncRelease() but an extra check is included if the slot indeed holds a mutex.

0x27 taskQueuReadRequestOnName: Call to take possession of a queue on name.
Tbool taskQueuRequestOnName(Tlit SlotName, Tuint16 uiTicksToWait)
Tbool taskQueuRequestOnName(Tlit SlotName)
Tbool taskQueuWriteRequestOnName(Tlit SlotName, Tsint08 siFreeFilling, Tuint16 uiTicksToWait)
Tbool taskQueuWriteRequestOnName(Tlit SlotName, Tsint08 siFreeFilling)
Tbool taskQueuReadRequestOnName(Tlit SlotName, Tsint08 siFreeFilling, Tuint16 uiTicksToWait)
Tbool taskQueuReadRequestOnName(Tlit SlotName, Tsint08 siFreeFilling)
Call this if you want to take possession of a queue. Use the (literal) slot name. You must specify the number of bytes you want to read or write, which can be anything from 0 up to 127, boundaries included. The task blocks until the queue is available.
     You must specify a timeout, if cfgUseTimeout is activated. You can specify anything from 2 to defDelayTimeMax. If you need an infinite wait, specify defLockBlockInfinite, and if you want an immediate return specify defLockDoNotBlock, to make your intentions clear. The method returns true or false. True means that the lock has been obtained, false means a timeout.

0x28 taskQueuReleaseOnName: Release the lock on a queue, by name
void taskQueuReleaseOnName(Tlit SlotName)
These macro make it possible to release a lock on a queue on the basis of the name. It performs the same action as taskSyncRelease() but an extra check is included if the slot indeed holds a queue.

0x27 taskSyncRequest: Try to obtain a lock on a queue , on a mutex or both.
Tbool taskSyncRequest(Tuint08 uiSlotSlot, Tsint08 siFreeLeftFilling, Tsint08 siFreeRightFilling, Tuint16 uiTicksToWait)
Tbool taskSyncRequest(Tuint08 uiSlotSlot, Tsint08 siFreeRightFilling, Tuint16 uiTicksToWait)
void taskSyncRequest(Tuint08 uiSlotSlot, Tsint08 siFreeLeftFilling, Tsint08 siFreeRightFilling)
void taskSyncRequest(Tuint08 uiSlotSlot, Tsint08 siFreeRightFilling)
The method taskSyncRequest is the general way to obtain a lock on a mutex or queue. It is even possible to obtain a simultaneous lock on two mutexes, two queues or a mutex and a queue. Simultaneous locks hold the task blocked until both resources are free. The uiSlotSlot, may contain one slot as parameter (the least significant nibble) or two slots, one in the low nibble and one in the high nibble. Only a slot in the high nibble is not allowed, even as two identical slots. (Would not make much sense either). For queue's you must specify if , and how many bytes are to be read (>0) or written (<0), maximally 127 bytes.
     The request blocks until the requested number of bytes is available for reading or writing. If you just want access to the queue, supply 0. For mutexes, supply zero for the free filling parameter (in practice it is ignored, but gives an error if method checking is activated)
     You can specify a timeout, if cfgUseTimeout is activated, in which case it may return false, indicating a timeout. It returns true if the lock was obtained.
     Slots must be configured as queue's in the config section. queue always fill up the lowest slot numbers, thus 1..n where n is the maximum number of queue's. The mutexes are numbered n+1 ... n+m, where m is the number of mutexes. But, it is easier to make use of named queues and muytexes. If you do, make use of the predefined macro's for easy access to the method defined below.

0x28 taskSyncRelease: Release a queue, on a mutex or both.
void taskSyncRelease(Tuint08 uiSlotSlot)
After you have taken a queue, mutex or both, you must release them with this call, to unblock other tasks. There is no obligation to release slots which are taken simultaneously in the same manner, but it is allowed. Also, you may use this function to release more than one slot, even if they where not taken simultaneously. This may be used to influence the way other tasks are deblocked. For clarity however, it is best to release in the same manner as the slots where locked.

0x28 taskSyncReleaseOnName: Release the lock on a queue or mutex, by name.
void taskSyncReleaseOnName(Tlit SlotLeftName, Tlit SlotRightName)
These macro make it possible to release locks on the basis of the name. If other tasks had a lock on the queue the system checks all task with respect to their lock condition. The first task that meets the requirement will be released. Scanning is done in task number order, not in priority order. The macros containing the type of slot contain code which check the type of the slot, if cfgCheckMethodUse is activated. So preferable use these. When making use of double slots the distinction between mutex and queue cannot be made.

0x27 taskSyncReadReadRequestOnName: Call to take possession of a queue, mutex or both.
0x27 taskSyncReadReadRequestOnName: Call to take possession of a queue, mutex or both.
0x27 taskSyncReadReadRequestOnName: Call to take possession of a queue, mutex or both.
0x27 taskSyncReadReadRequestOnName: Call to take possession of a queue, mutex or both.
Tbool taskSyncWriteWriteRequestOnName(Tlit SlotLeftName, Tlit SlotRightName, Tsint08 siFreeLeftFilling, Tsint08 siFreeRightFilling, Tuint16 uiTicksToWait)
Tbool taskSyncWriteWriteRequestOnName(Tlit SlotLeftName, Tlit SlotRightName, Tsint08 siFreeLeftFilling, Tsint08 siFreeRightFilling)
Tbool taskSyncReadWriteRequestOnName(Tlit SlotLeftName, Tlit SlotRightName, Tsint08 siFreeLeftFilling, Tsint08 siFreeRightFilling, Tuint16 uiTicksToWait)
Tbool taskSyncReadWriteRequestOnName(Tlit SlotLeftName, Tlit SlotRightName, Tsint08 siFreeLeftFilling, Tsint08 siFreeRightFilling)
Tbool taskSyncWriteReadRequestOnName(Tlit SlotLeftName, Tlit SlotRightName, Tsint08 siFreeLeftFilling, Tsint08 siFreeRightFilling, Tuint16 uiTicksToWait)
Tbool taskSyncWriteReadRequestOnName(Tlit SlotLeftName, Tlit SlotRightName, Tsint08 siFreeLeftFilling, Tsint08 siFreeRightFilling)
Tbool taskSyncReadReadRequestOnName(Tlit SlotLeftName, Tlit SlotRightName, Tsint08 siFreeLeftFilling, Tsint08 siFreeRightFilling, Tuint16 uiTicksToWait)
Tbool taskSyncReadReadRequestOnName(Tlit SlotLeftName, Tlit SlotRightName, Tsint08 siFreeLeftFilling, Tsint08 siFreeRightFilling)
Call this if you want to take possession of two queue's, mutexes or one queue and one mutex. Use the (literal) slotnames. You must specify the number of bytes you want to read or write for queues, which can be anything from 0 up to 127, boundaries included. For mutexes specify 0 for the free filling. The task blocks until both resources are available.
     You must specify a timeout, if cfgUseTimeout is activated. You can specify anything from 2 to defDelayTimeMax. If you need an infinite wait, specify defLockBlockInfinite, and if you want an immediate return specify defLockDoNotBlock, to make your intentions clear. The method returns true or false. True means that the lock has been obtained, false means a timeout.

0x26 taskWaitForOtherTask: Lock this task until an other tasks pass on the same slot.
Tbool taskWaitForOtherTask(Tuint08 uiSlot, Tuint16 uiTicksToWait)
void taskWaitForOtherTask(Tuint08 uiSlot)
Tbool taskWaitForOtherTaskOnName(Tlit SlotName, Tuint16 uiTicksToWait)
void taskWaitForOtherTaskOnName(Tlit SlotName)
Use this function to hold one task and let it wait for an other task to pass the same lock. In other words it is a simple rendezvous You can specify a timeout, if cfgUseTimeout is activated. The function returns true if the rendezvous took place, false otherwise.

0x26 taskWaitForTasks: Lock this task until n other tasks pass on the same slot.
Tbool taskWaitForTasks(Tuint08 uiSlot, Tuint08 uiNumberOfTasks, Tuint16 uiTicksToWait)
void taskWaitForTasks(Tuint08 uiSlot, Tuint08 uiNumberOfTasks)
Tbool taskWaitForTasksOnName(Tlit SlotName, Tuint08 uiNumberOfTasks, Tuint16 uiTicksToWait)
void taskWaitForTasksOnName(Tlit SlotName, Tuint08 uiNumberOfTasks)
Use this function to hold one or more tasks and let it wait for the given number of tasks to pass the same lock. In other words it is a rendezvous of N (uiNumberOfTasks) tasks. Make sure N is equal on all calls because as soon as the number of tasks is equal or lower a the value specified all are released. You can specify a timeout, if cfgUseTimeout is activated. The function returns true if the rendezvous took place, false otherwise.

---- isrBegin: Start the isr, switch to the isr stack.
isrBegin()
isrBegin() is used when you want the interrupt to be serviced as quickly as possible. No context is saved, so you are responsible for saving and restoring any registers you use, including the status register. You can however let GCC take care of this. Note that, if you use many registers, this may take more time than a context save. Advantage is that you can interrupt the OS if you want, depending on the setting of cfgIntOsProtected. If you want to measure the time spend inside the interrupt you must manually call the irsStartLoad/isrStopLoad routines, and make sure you save the registers utilized inside as well. Note that, in this case, the system is not able to deduce the time spend in the isr from the time measurement for the process (task/os/idle) that was running at the moment. So that time is counted twice.

---- isrEndReturn: Stop the isr, return to the place where the interrupt occurred.
isrEndReturn()
isrEndReturn(): use this to return from a isr to the place the interrupt occurred. It is your only option is you have no OS protection. Restore anything you corrupted, this is your own responsibility. The only thing the isrBegin() / isrReturn() pair takes care of is the stack switch. So inside the isr you have the ISR stack.

---- isrEndYield: Stop the isr, yield as quickly as possible
isrEndYield()
isrEndYield(): use this if you want a context switch directly after the handling of your interrupt. You are still responsible for restoring any registers, so it only makes sense to use isrBegin() / isrYield() over isrEnter() / isrExit() if your response to the interrupt need to be very fast and does not require that many operations. Since this method calls taskYield() that method must be included too.

---- isrEnter: Start the isr by a context switch.
isrEnter()
Use isrEnter() to start an isr with a context switch. The current task is pushed to the context (so this is only available when the interrupts comes when a task is running, i.e. cfgIntOsProtected must be set) and, depending on the setting of cfgIntSwitchUsesOSstack work is continued on the OS or ISR stack. Always close the isr with isrExit(). If selected the time spend in the isr is measured automatically

---- isrExit: End the isr, switch to the OS.
isrExit()
Use isrEnter() to start an isr with a context switch. The current task is pushed to the context (so this is only available when the interrupts comes when a task is running, i.e. cfgIntOsProtected must be set) and, depending on the setting of cfgIntSwitchUsesOSstack work is continued on the OS or ISR stack. Always close the isr with isrExit().

---- isrStackCheck: Call to check how much free space is left on the isr stack.
Tuint08 isrStackCheck(Tuint08 uiExtraStackSafety)
With this function you call check the amount of free space in the isr stack. (a context switch never happens here). This function only works when cfgCheckIsrStack set to cfgTrue. Otherwise the function is still defined, but returns 0, so that it does need to be removed every time you switch the cfgCheckIsrStack setting. With the parameter uiExtraStackSafety you can supply how much extra space you require at this place. Note that the total of present isr stack size and uiExtraStackSafety should not exceed the 255 bytes. This function returns the amount of free (real) isr stack space at the moment of calling, apart from the safety parameters. Of course the 2 bytes as result of the call are extra.
     This function does not operate when cfgIntSwitchUsesOSstack is set to true since in that case the isr makes use of the OS stack.

---- isrStartLoad: Start measuring the time spend in an isr.
void isrStartLoad(void)
IsrStartLoad measures the total time spend in interrupts. You only need to call it at the beginning of your interrupt service routine if you took own responsibility of the context save, i.e. if you came at the place with isrBegin. It starts the stopwatch for measuring the time inside an isr. You can leave the call in you code when switching off cfgUseLoadMonitor, it will be replaced by an empty statement.

---- isrStopLoad: Stop measuring the time spend in an isr.
void isrStopLoad(void)
IsrStopLoad measures the total time spend in interrupts. You only need to call it at the end of your interrupt service routine if you took own responsibility of the context save, i.e. before you leave with isrEndYield() or isrEndReturn(). It stops the stopwatch for measuring the time inside an isr. You can leave the call in you code when switching off cfgUseLoadMonitor, it will be replaced by an empty statement.

0x0D taskEnableGlobalInterrupts: Enable global interrupts, trace when needed
taskEnableGlobalInterrupts()
taskEnable/DisableGlobalInterrupts makes it possible to set/clear the global interrupt flag. Don't call portEnable, but call taskEnable to make you code general. Note these calls cannot be nested, i.e. they are absolute and work instantly. If cfgCheckTrace is switched on, the call is traced. Never call Enable/Disable interrupts inside critical sections.

0x0E taskDisableGlobalInterrupts: Disable global interrupts, trace when needed
taskDisableGlobalInterrupts()
taskEnable/DisableGlobalInterrupts makes it possible to set/clear the global interrupt flag. Don't call portEnable, but call taskEnable to make you code general. Note these calls cannot be nested, i.e. they are absolute and work instantly. If cfgCheckTrace is switched on, the call is traced. Never call Enable/Disable interrupts inside critical sections.

0x13 taskEnterGlobalCritical: Enter global critical section
void taskEnterGlobalCritical(void)
Use taskEnter/ExitGlobalCritical if you need nested (de)activation of the global interrupts. Nesting is only active when cfgUseNestedCriticals is set, otherwise these calls are replaced by simple taskEnterGlobalCritical. Thus, in fact you can always use this call, and decide later on on its functionality. It is the most general way. The same mechanism about interrupt tracking applies as with taskEnable/ DisableGlobalInterrupts.

0x14 taskExitGlobalCritical: Exit global critical section
void taskExitGlobalCritical(void)
Use taskEnter/ExitGlobalCritical if you need nested (de)activation of the global interrupts. Nesting is only active when cfgUseNestedCriticals is set, otherwise these calls are replaced by simple taskExitGlobalCritical. Thus, in fact you can always use this call, and decide later on on its functionality. It is the most general way. The same mechanism about interrupt tracking applies as with taskEnable/ DisableGlobalInterrupts.

0x11 taskEnableSwitchTask: Enable task switching.
void taskEnableSwitchTask(void)
Call this to unblock context switching. The task looses its dominant position. Task switching is restored, and high priority tasks are rescheduled. Call after a taskDisableSwitchTask().
     Do not call this if you make use of Enter/Exit Switch critical sections. since it disturbs the nesting counting. In fact, it is even better to use taskEnterSwitchCritical() and taskExitSwitchCritical(), even if you do not need nesting. The system then translates this to taskEnableSwitchTask or taskDisableSwitchTask.

0x12 taskDisableSwitchTask: Disable task switching.
void taskDisableSwitchTask(void)
Call this to block context switching. The task becomes dominant. The tick interrupts keep coming, and the tick counter keeps increasing and delayed task wakeup etcetera. Only thing is, there are no task switches, thus by using this method a low priority task can take (keep it temporarily) full processor time, and will behave like a top priority task.
     The system will prevent switching while possible. Thus, your task will keep complete load as long as you do not block, call sleep, suspend or terminate your task. Calling delay is possible, and the system will go idle during the delay, but will not start an other task. If it is not possible to maintain your task for whatever reason (for example an isr calls suspend on the task) an other task will run, but as soon as the the original task is revived it will regain control when it was sleeping or suspended. When you call a blocking function, it will lose the block, which can be seen as an error. A dominant state may not be restarted either.
     If a switching interrupt takes place during the time one of the tasks is dominant, context will be saves and the interrupt is handled. Afterwards the dominant task is restarted, even if, for example, the isr revived a task with higher priority.
     If you call this on a task with shared stack, the task will become dominant as long as the shared task is active. Cancel the dominant state before you restart. If you all the tasks have a shared stack, the dominant state is without meaning and should not be used.
     Regarding file system operations the following applies. Opening a file cannot be done while in dominant mode, since other tasks may hold a write lock on the file system so it may block. If only one task is using the file system (defined through the capabilities), blocking on file open cannot occur, and opening a file in dominant mode is allowed. After opening, you may switch on the dominant mode, for all subsequent file operations. All possible write blocks on the file system are handled by spin locks, since their release do not depend on other tasks to act.
     Do not call this if you make use of Enter/Exit Switch critical sections. since it disturbs the nesting counting. In fact, it is even better to use taskEnterSwitchCritical() and taskExitSwitchCritical(), even if you do not need nesting. The system then translates this to taskEnableSwitchTask or taskDisableSwitchTask.

0x17 taskEnterSwitchCritical: Enter task switch critical section
void taskEnterSwitchCritical(void)
Calling taskEnterSwitchCritical makes the task dominant, and can be called multiple times within the task.
     Use taskEnter/ExitSwitchCritical if you need nested (de)activation of the task switches. Nesting is only active when cfgUseNestedCriticals is set, otherwise these calls are replaced by simple taskDisableSwitchTask() or taskEnableSwitchTask(). Thus, in fact you can always use this call, and decide later on on its functionality. It is the most general way.
     Please note that if you violate the conditions under which the switch critical section is issued (for example you require a mutex which may block) you may loose the switch block, but the the nesting counting is not reset. Subsequent exits of the critical section remain needed, although the block may have been lost.

0x18 taskExitSwitchCritical: Exit task switch critical section
void taskExitSwitchCritical(void)
Calling taskExitSwitchCritical() counteracts the corresponding enter calls, and when the number of exit equals the number of enters, the task looses its dominant position.
     Use taskEnter/ExitSwitchCritical if you need nested (de)activation of the task switches. Nesting is only active when cfgUseNestedCriticals is set, otherwise these calls are replaced by simple taskDisableSwitchTask() or taskEnableSwitchTask(). Thus, in fact you can always use this call, and decide later on on its functionality. It is the most general way.

0x0F taskEnableTickInterrupts: Enable Tick interrupts, trace when needed
void taskEnableTickInterrupts(void)
taskEnable/DisableTickInterrupts makes it possible to set/clear the Tick interrupt flag. Don't call portEnable, but call taskEnable to make you code general. Note these calls cannot be nested, i.e. they are absolute and work instantly. If cfgCheckTrace is switched on, the call is traced. Never call Enable/Disable interrupts inside critical sections.

0x10 taskDisableTickInterrupts: Disable Tick interrupts, trace when needed
void taskDisableTickInterrupts(void)
taskEnable/DisableTickInterrupts makes it possible to set/clear the Tick interrupt flag. Don't call portEnable, but call taskEnable to make you code general. Note these calls cannot be nested, i.e. they are absolute and work instantly. If cfgCheckTrace is switched on, the call is traced. Never call Enable/Disable interrupts inside critical sections.

0x15 taskEnterTickCritical: Enter Tick critical section
void taskEnterTickCritical(void)
Use taskEnter/ExitTickCritical if you need nested (de)activation of the Tick interrupts. Nesting is only active when cfgUseNestedCriticals is set, otherwise these calls are replaced by simple taskEnterTickCritical. Thus, in fact you can always use this call, and decide later on on its functionality. It is the most general way. The same mechanism about interrupt tracking applies as with taskEnable/ DisableTickInterrupts.

0x16 taskExitTickCritical: Exit Tick critical section
void taskExitTickCritical(void)
Use taskEnter/ExitTickCritical if you need nested (de)activation of the Tick interrupts. Nesting is only active when cfgUseNestedCriticals is set, otherwise these calls are replaced by simple taskExitTickCritical. Thus, in fact you can always use this call, and decide later on on its functionality. It is the most general way. The same mechanism about interrupt tracking applies as with taskEnable/ DisableTickInterrupts.

---- isrFireEvent: Call this to fire an event from the isr.
void isrFireEvent(Tuint08 uiEvent)
This method is not a regular method but a define, to be as quick as possible. It is assumed to compiler is able to compile it into a single bit-write instruction (avr). If this is not possible, be sure you only call it when interrupts are disabled, usually from an isr. GCC is able to compile this into an atomic instruction for the AVR provided you supply a constant, or if you use the isrFireEventOnName() call, and the register devAuxEventReg is the lowest I/O section (0x00-0x1F). So you should not call it with a variable. If you need to fire more events, call this function several times, once for each event. Note that this call is never traced.
     A specialty of this method is that it can be utilized on the AVR within naked signal handlers without any register saving, provided it compiles to an atomic instruction. This makes interrupt handling extremely fast. Just release some task and go on. The interrupt handles does not need to contain more that two instructions.
     Merely firing an event does not require the task to have event capabilities, it is even more efficient when the task does not include the capabilities. Waiting for an event however does.
     If you obtain a "left shift count is negative" from the compiler upon your call you have used an invalid event number, less than zero, bigger then 7 or equal to the AuxRegBit of the Femto OS (the registers for events and the Femto OS auxiliary register may be shared, but in that case you may not use the one bit Femto OS needs). Please correct the situation and do not ignore it just because it is a only warning.

---- genFireEvent: Call this to fire an event from any place.
void genFireEvent(Tuint08 uiEvent)
This method is a regular method or a define, depending on circumstances. If devAuxEventReg is the lowest I/O section (0x00-0x1F), and tracing is deactivated and we make no use of cfgUseEventsOnVariables then this is identical to isrFireEvent. Otherwise a special method is defined which disables global interrupts first, and subsequently traces, checks or otherwise handles the call. It may be used from any location, including an isr, but of course it can be a lot slower/larger. When cfgUseEventsOnVariables is used, you may call isrFireEvent with a variable as parameter.
     Merely firing an event does not require the task to have event capabilities, it is even more efficient when the task does not include the capabilities. Waiting for an event however does.
     If you obtain a "left shift count is negative" from the compiler upon your call you have used an invalid event number, less than zero, bigger then 7 or equal to the AuxRegBit of the Femto OS (the registers for events and the Femto OS auxiliary register may be shared, but in that case you may not use the one bit Femto OS needs). Please correct the situation and do not ignore it just because it is only a warning.

0x3A genFireEventSet: Call this to release tasks waiting for an different events.
void genFireEventSet(Tuint08 uiEventSet)
void genFireEventSetOnNames2(Tlit EventName1, Tlit EventName2)
void genFireEventSetOnNames3(Tlit EventName1, Tlit EventName2, Tlit EventName3)
void genFireEventSetOnNames4(Tlit EventName1, Tlit EventName2, Tlit EventName3, Tlit EventName4)
void genFireEventSetOnNames5(Tlit EventName1, Tlit EventName2, Tlit EventName3, Tlit EventName4, Tlit EventName5)
void genFireEventSetOnNames6(Tlit EventName1, Tlit EventName2, Tlit EventName3, Tlit EventName4, Tlit EventName5, Tlit EventName6)
void genFireEventSetOnNames7(Tlit EventName1, Tlit EventName2, Tlit EventName3, Tlit EventName4, Tlit EventName5, Tlit EventName6, Tlit EventName7)
void genFireAllEvents()
Using this call you may fire any combination of events simultaneously. Note it is a real function call and is not compiled to one atomic instruction. Call genFireAllEvents() to release a blocking tasks at once. The execution of this method takes place in a non interruptible realm.
     Merely firing events does not require the task to have event capabilities, it is even more efficient when the task does not include the capabilities. Waiting for an event however does.

0x49 genCountEventBlocks: Call to get the number of blocks on a combination of events.
Tuint08 genCountEventBlocks(Tuint08 uiEventSet)
void genCountEventBlocksOnNames2(Tlit EventName1, Tlit EventName2)
void genCountEventBlocksOnNames3(Tlit EventName1, Tlit EventName2, Tlit EventName3)
void genCountEventBlocksOnNames4(Tlit EventName1, Tlit EventName2, Tlit EventName3, Tlit EventName4)
void genCountEventBlocksOnNames5(Tlit EventName1, Tlit EventName2, Tlit EventName3, Tlit EventName4, Tlit EventName5)
void genCountEventBlocksOnNames6(Tlit EventName1, Tlit EventName2, Tlit EventName3, Tlit EventName4, Tlit EventName5, Tlit EventName6)
void genCountEventBlocksOnNames7(Tlit EventName1, Tlit EventName2, Tlit EventName3, Tlit EventName4, Tlit EventName5, Tlit EventName6, Tlit EventName7)
void genCountEventBlocksOnAll()
You may want to postpone firing an event until one or more tasks are actually blocking on it. Call this to get the current number of tasks blocking on all the events given. If it is called in isr or interrupt protected environment the number is accurate. If not it is a lower bound, when the calling task is the only one capable of firing the particular event.

0x02 taskWaitForEvent: Call to let the task wait for one specific event in the system.
Tbool taskWaitForEvent(Tuint08 uiEvent, Tuint16 uiTicksToWait)
Tbool taskWaitForEvent(Tuint08 uiEvent)
void taskWaitForEventOnName(Tlit EventName, Tuint16 TicksToWait)
void taskWaitForEventOnName(Tlit EventName)
void taskWaitForAllEvents()
This function is used as a lightweight alternative to synchronization to slots. There are 8 predefined events ready to use. If you call this function the task blocks until the events has fired. Firing event is possible from within an isr, even if the OS is set interruptible. Thus this can make you application very responsive, while not being bound to handle all matters inside an isr. Any task being able to wait for events must have the CapEvent capability.
     Note, if you use a number, that should be the number of the event itself, thus a number 0 ... 7 (borders included). It is easier to work with names though.

0x02 taskWaitForEventSet: Call to let the task wait for more specific events in the system.
Tbool taskWaitForEventSet(Tuint08 uiEventSet, Tuint16 uiTicksToWait)
Tbool taskWaitForEventSet(Tuint08 uiEventSet)
void taskWaitForEventSetOnNames2(Tlit EventName1, Tlit EventName2)
void taskWaitForEventSetOnNames3(Tlit EventName1, Tlit EventName2, Tlit EventName3)
void taskWaitForEventSetOnNames4(Tlit EventName1, Tlit EventName2, Tlit EventName3, Tlit EventName4)
void taskWaitForEventSetOnNames5(Tlit EventName1, Tlit EventName2, Tlit EventName3, Tlit EventName4, Tlit EventName5)
void taskWaitForEventSetOnNames6(Tlit EventName1, Tlit EventName2, Tlit EventName3, Tlit EventName4, Tlit EventName5, Tlit EventName6)
void taskWaitForEventSetOnNames7(Tlit EventName1, Tlit EventName2, Tlit EventName3, Tlit EventName4, Tlit EventName5, Tlit EventName6, Tlit EventName7)
void taskWaitForAllEvents()
void taskWaitForEventSetOnNames2(Tlit EventName1, Tlit EventName2, Tuint16 TicksToWait)
void taskWaitForEventSetOnNames3(Tlit EventName1, Tlit EventName2, Tlit EventName3, Tuint16 TicksToWait)
void taskWaitForEventSetOnNames4(Tlit EventName1, Tlit EventName2, Tlit EventName3, Tlit EventName4, Tuint16 TicksToWait)
void taskWaitForEventSetOnNames5(Tlit EventName1, Tlit EventName2, Tlit EventName3, Tlit EventName4, Tlit EventName5, Tuint16 TicksToWait)
void taskWaitForEventSetOnNames6(Tlit EventName1, Tlit EventName2, Tlit EventName3, Tlit EventName4, Tlit EventName5, Tlit EventName6, Tuint16 TicksToWait)
void taskWaitForEventSetOnNames7(Tlit EventName1, Tlit EventName2, Tlit EventName3, Tlit EventName4, Tlit EventName5, Tlit EventName6, Tlit EventName7, Tuint16 TicksToWait)
void taskWaitForAllEvents(Tuint16 TicksToWait)
This function is used as a lightweight alternative to synchronization to slots. There are 8 predefined events ready to use. If you call this function on several events, the task blocks until all of these events have fired. Events are typically fired one at the time, so the task is reactivated when the last event has fired. Firing event is possible from within an isr, even if the OS is set interruptible. Thus this can make you application very responsive, while not being bound to handle all matters inside an isr. Any task being able to wait for events must have the CapEvent capability.
     The uiEventSet is a binary pattern, the events are represented by a set bit on their location. So if you want to wait on events 5 and 0 supply the byte 0x21. Waiting for event set 0x00 results in a direct context switch, since there is nothing to wait for. It is easier to work with names though.

0x20 taskFileAppendByte: Add one byte to the file, starting at the beginning when full.
void taskFileAppendByte(Tuint08 uiFileNumber, Tbyte bItem)
void taskFileAppendByteOnName(Tlit FileName, Tbyte bItem)
The call taskFileAppendByte() adds one byte to the file in a size maintained manner (only available if cfgUseFileSystemMaintainFAT is activated). The byte is first written, and subsequently the file size is increased. In case of power failure in between, it is as if the file was never extended. If the file is full, the byte is written at the beginning, so that this call may be used to implement a ring buffer. In the latter case, the file size is set to zero first, then the byte is written and subsequently the size is set to one. Only use after taskFileOpen().

0x1D taskFileClear: Clear the file by setting its size to zero, contents are unchanged.
void taskFileClear(Tuint08 FileNumber)
void taskFileClearOnName(Tlit FileName)
If cfgUseFileSystemMaintainFAT is activated the size of each file is maintained by the Femto OS. It is however possible to change the size to zero using this call. Setting the size to zero does not really remove the file (the bytes stay present), Only use after taskFileOpen().

0x1A taskFileClose: Close the file system, so other tasks may obtain access.
void taskFileClose(void)
Every call taskFileOpen() must be closed with a call to taskFileClose(). This signals the Femto OS that you are ready read/writing. It is an error to call taskFileClose() if the file access has not been opened before. If other tasks are waiting to obtain file access, calling taskFileClose() may immediately release such blocked tasks, possibly starving the current task if it runs in lower priority.

---- taskFileDirectRead: Direct read function on the file system.
Tbyte taskFileDirectRead(Taddress pAddress)
Sometimes it is convenient to have direct access to the file system. Instead of using the portFSReadByte, use this macro instead. It returns the value at the given address on the file system. Make sure you only call this if you are certain you have read access. For normal file operations use taskFileReadByte() or taskFileReadBuffer() instead.

---- taskFileDirectWrite: Direct write function on the file system.
void taskFileDirectWrite(Taddress pAddress, Tbyte bValue)
Sometimes it is convenient to have direct access to the file system. Instead of using the portFSWriteByte, use this macro instead. It stores the value at the given address on the file system. Make sure you only call this if you are certain you have write access. For normal file operations use taskFileWriteByte() or taskFileWriteBuffer() instead.

0x1B taskFileFormat: Clean (fill with zero's) the whole disk space.
void taskFileFormat(void)
void taskFileFormatOnName(Tlit FileName)
If you need to clean the dis kspace call taskFileFormat. The space used for files (and only that part) is filled with zero's. Since the FAT is situated at the start of this region, all files are set to length zero. If you set the size of these files to other values afterwards, you can be sure that file is filled with 0x00. There is no need to clean format the file system before use, but you must be ensure file system integrity yourself before first use. Only use after taskFileOpen().

0x1C taskFileGetSize: Get the present size of a file.
Tuint08 taskFileGetSize(Tuint08 uiFileNumber)
Tuint08 taskFileGetSizeOnName(Tlit FileName)
If cfgUseFileSystemMaintainFAT is activated the size of each file is maintained by the Femto OS. Using the call you can obtain the size of the file. Only use after taskFileOpen().

0x19 taskFileOpen: Open the file system for writing and/or reading.
Tbool taskFileOpen(Tbool bReadOnly, Tuint16 uiTicksToWait)
Tbool taskFileOpen(Tuint16 uiTicksToWait)
void taskFileOpen(Tbool bReadOnly)
void taskFileOpen(void)
Before you can read or write a file you must request access to the file system. If you need to read only, you can specify so, thereby allowing other tasks read access to the file system too. If read only is false (or absent) you have private access to the file system, for reading and writing. As with other synchronization primitives you may specify a timeout.
     The function returns true when access has been granted. If you need to use the portReadByte() or portWriteByte() directly, call taskFileOpen() first and then make your calls. Note that, due to the nature of eeprom, fileOpen() works as access protection for the whole file system, and not per file. So you may make use of several files simultaneously within the realm of taskFileOpen() - taskFileClose(). taskFileOpen() calls may not be nested.

0x23 taskFileReadBuffer: Read several bytes from the file and push them to the buffer.
void taskFileReadBuffer(Tuint08 uiFileNumber, Tuint08 uiOffset, Tuint08 uiSize, Taddress pBuffer)
void taskFileReadBufferOnName(Tlit FileName, Tuint08 uiOffset, Tuint08 uiSize, Taddress pBuffer)
Call this method to read one or more bytes (uiSize) from position uiOffset and write them in the buffer. You can use defFromFileStart for the uiOffset parameter. Furthermore, you can use (if cfgUseFileSystemMaintainFAT is activated) defUntilFileEnd for uiSize. Note that, depending on your design of course, you should not assume a file is present. If there was a power failure at writing, the file length may be set to zero. If the length of the file does not equal zero, you may safely assume writing has been competed, before any power interruption took place. It is an error to read beyond the file size. Only use after taskFileOpen().

0x1E taskFileReadByte: Get one byte from a file using a raw read.
Tbyte taskFileReadByte(Tuint08 uiFileNumber, Tuint08 uiOffset)
Tbyte taskFileReadByteOnName(Tlit FileName, Tuint08 uiOffset)
Call taskFileReadByte() if you need one byte from a file on a random location. It is an error (but possible if checks are switched off) to read beyond the length of the file (if cfgUseFileSystemMaintainFAT is activated) or beyond the space boundary of the file. Only use after taskFileOpen().

0x21 taskFileReadPipe: Read several bytes from the file and push them to the pipe.
void taskFileReadPipe(Tuint08 uiFileNumber, Tuint08 uiOffset, Tuint08 uiSize, void (*pipe)(Tchar))
void taskFileReadPipeOnName(Tlit FileName, Tuint08 uiOffset, Tuint08 uiSize, void (*pipe)(Tchar))
Call this method to read one or more bytes (uiSize) from position uiOffset and push them on the pipe. You can use defFromFileStart for the uiOffset parameter. Furthermore, you can use (if cfgUseFileSystemMaintainFAT is activated) defUntilFileEnd for uiSize. Note that, depending on your design of course, you should not assume a file is present. If there was a power failure at writing, the file length may be set to zero. If the length of the file does not equal zero, you may safely assume writing has been competed, before any power interruption took place. It is an error to read beyond the file size. Only use after taskFileOpen().

0x1D taskFileSetSize: Give the file a new size, contents are unchanged.
void taskFileSetSize(Tuint08 uiFileNumber, Tuint08 uiSize)
void taskFileSetSizeOnName(Tlit FileName, Tuint08 uiSize)
If cfgUseFileSystemMaintainFAT is activated the size of each file is maintained by the Femto OS. It is however possible to change the size using this call. If the file is extended in this way, the new bytes will not be cleaned. Using the raw access taskWriteByte() these may be filled or cleaned on beforehand. It is an error to increase the size beyond the space reserved for the file at compile time. Only use after taskFileOpen().

0x24 taskFileWriteBuffer: Read several bytes from the buffer and put the on file.
void taskFileWriteBuffer(Tuint08 uiFileNumber, Tuint08 uiOffset, Tuint08 uiSize, Taddress pBuffer)
void taskFileWriteBufferOnName(Tlit FileName, Tuint08 uiOffset, Tuint08 uiSize, Taddress pBuffer)
Call this method to read one or more bytes (uiSize) from the buffer and write them to the file, starting at the position uiOffset. You can use defFromFileStart or, if cfgUseFileSystemMaintainFAT is activated, defFromFileEnd for the uiOffset parameter. It is an error to write beyond the file space. Before any writing is done, the size of the file is set to zero. After the writing has been completed, the new size is written to the FAT (when present). The procedure is to ensure file system integrity at power failure. Only use after taskFileOpen().

0x1F taskFileWriteByte: Write one byte to a file using a raw write.
void taskFileWriteByte(Tuint08 uiFileNumber, Tuint08 uiOffset, Tbyte bItem)
void taskFileWriteByteOnName(Tlit FileName, Tuint08 uiOffset, Tbyte bItem)
Call taskFileWriteByte() if you need to write one byte to a file on a random location. The write is raw in the sense that the fileSize is not maintained. You may write bytes beyond the file length, but not beyond the space boundary. For example, you may write, zero's to a file first and afterwards set its length to the desired value. Only use after taskFileOpen().

0x22 taskFileWritePipe: Read several bytes from the pipe and put the on file.
void taskFileWritePipe(Tuint08 uiFileNumber, Tuint08 uiOffset, Tuint08 uiSize, Tchar (*pipe)(void))
void taskFileWritePipeOnName(Tlit FileName, Tuint08 uiOffset, Tuint08 uiSize, Tchar (*pipe)(void))
Call this method to read one or more bytes (uiSize) from the pipe and write them to the file, starting at the position uiOffset. You can use defFromFileStart or, if cfgUseFileSystemMaintainFAT is activated, defFromFileEnd for the uiOffset parameter. It is an error to write beyond the file space. Before any writing is done, the size of the file is set to zero. After the writing has been completed, the new size is written to the FAT (when present). The procedure is to ensure file system integrity at power failure. Only use after taskFileOpen().

defAllEvents: Literal value to fire all events in the genFireEventSet method.
#define defAllEvents
If you need to unblock all waiting tasks by firing all all events use this constant in the method genFireEventSet. It makes your intentions clear.

defCurrentTaskName: Literal value to specify the current task.
#define defCurrentTaskName
In all (external) methods accepting the TaskName parameter you can specify defCurrentTask to indicate you want to use it for the current task, if you do not know that name (for example when code is run from different tasks). Never use it as a number in your code Please be absolutely sure you are inside a real task. If you are inside an isr, inside init or bark routines, you are not in task space and the current task may not be what you expect. However, the system cannot warn you for this situation. Thus, only to be used inside code that was called from appLoop_XXX.

defCurrentTaskNumber: Value to specify the current task.
#define defCurrentTaskNumber
In all (external) methods accepting the uiTaskNumber parameter you can specify defCurrentTaskNumber to indicate you want to use it for the current task, if you do not know that number (for example when code is run from different tasks). Please be absolutely sure you are inside a real task. If you are inside an isr, inside init or bark routines, you are not in task space and the current task may not be what you expect. However, the system cannot warn you for this situation. Thus, only to be used inside code that was called from appLoop_XXX.

defFromFileEnd: Literal value to state to start at the end of a file.
#define defFromFileEnd
In most file operation calls you can specify an offset. Instead of using the real file length (which you must know or obtain), you may use this constant to start writing the new bytes at the end of the file. This constant is only available if cfgUseFileSystemMaintainFAT is activated.

defFromFileStart: Literal value to state to start at the beginning of a file.
#define defFromFileStart
In most file operation calls you can specify an offset. Instead of using zero, you may always use this constant to make your intention clear that you want to start reading or writing from the file start.

defLockBlockInfinite: Use in a synchronizing method to specify it may not timeout
#define defLockBlockInfinite
Value you can use to indicate that a lock need not to timeout. Use this rather than supply 0 to make your intentions clear.

defLockDoNotBlock: Use in a synchronizing method to say it must return immediately
#define defLockDoNotBlock
Value you can use to indicate that a lock need timeout immediately, thus just check if you can obtain the lock, but do not wait for it. Use this rather than supply 1 to make your intentions clear.

defDelayTimeMax: The highest delay time you may use.
#define defDelayTimeMax
The highest delay time you may use. If your tick time is 1ms, and since we have a 16 bit tick counter, the maximum delay is about 65 seconds. In my opinion, this is long enough. If you want to delay tasks longer it is better to get a real time signal somewhere else.

defDelayTimeZero: The lowest delay time you may use.
#define defDelayTimeZero
The lowest delay time you may use, which in practice means no delay at all, but it is better to use this constant than 0 to make your intentions clear.

defReadOnly: Literal value to state to open the file system in read only mode.
#define defReadOnly
If cfgUseFileSystemConcurrentRead is activated, it is required to specify if you want to open the file system in read only mode, or in read/write mode. Although, you can just use a boolean there, you may want to use this constant to make your intentions mode explicit.

defReadWrite: Literal value to state to open the file system in read/write mode.
#define defReadWrite
If cfgUseFileSystemConcurrentRead is activated, it is required to specify if you want to open the file system in read only mode, or in read/write mode. Although, you can just use a boolean there, you may want to use this constant to make your intentions mode explicit.

defStackInitByte: Value with which the stack is filled.
#define defStackInitByte
For testing purposes you can fill the stack with other values that 0x00. This may be handy to see if you are not misusing a register. For the shortest code, leave it to 0x00, so the compiler can rely upon the .bss section cleaning. For a discussion how to use this setting see also cfgSysRegisterCheckByte. Also see the discussion at defStackClean.

defUntilFileEnd: Literal value to state you want to run up to the end of a file.
#define defUntilFileEnd
In most file operation calls you can specify an size. Instead of using the real file length (which you must know or obtain), you may use this constant to keep reading bytes up to the end of the file. This constant is only available if cfgUseFileSystemMaintainFAT is activated.

preBitClr: Use this function as general method to clear bits.
#define preBitClr1(p,n0)
#define preBitClr2(p,n0,n1)
#define preBitClr3(p,n0,n1,n2)
#define preBitClr4(p,n0,n1,n2,n3)
#define preBitClr5(p,n0,n1,n2,n3,n4)
#define preBitClr6(p,n0,n1,n2,n3,n4,n5)
#define preBitClr7(p,n0,n1,n2,n3,n4,n5,n6)
#define preBitClr8(p,n0,n1,n2,n3,n4,n5,n6,n7)
Use this function to clear a one or more bits on a variable, or to modify one or more bits on a variable. For the AVR, if you use something like PORTA = preBitClr1(PORTA,3), it is compiled to an atomic instruction. The method is used internally since it can also deal with the cfgUndefined constant (which is ignored).
     Note: n0 .. n7 should be constants and not variables.

preEventNumberOf: Returns the number of an event named "EventName".
#define preEventNumberOf(EventName)
Using this function it is possible to use static names for the event instead of numbers. It returns the event number of an event with the compile time name "EventName". This function is implicitly called in all 'OnName' variants of the API calls. Make sure you correctly spell the name, since that is not checked here (and will give rise to a compile time warning only) Preferably uses names instead of numbers in your code since the numbering depends an the inclusions and may differ at different compiles. Substitution of the numbers is done at compile time and does not require code. Cannot be used in preprocessor statements.

preEqualMacros: Use to check if two macro's are equal.
#define preEqualMacros(A,B)
This is a handy function to test if two macros are equal if they do not expand down to a number. Note it can only be used in c-like if statements (not in preprocessor code) but that does not matter since the compiler optimizer sees that the argument can be fully evaluated at compile time.

preFileDefined: Use this function to see if a file is defined on a file name.
#define preFileNumberOf(FileName)
Use this function to see if a file is defined on a file name. Can be used in preproccessor statements

preFileNumberOf: Returns the file number of a file with the name "FileName".
#define preFileNumberOf(FileName)
Using this function it is possible to use static names for the files instead of numbers. It returns the file number of a file with the compile time name "FileName". This function is implicitly called in all 'OnName' variants of the API calls. Make sure you correctly spell the name, since that is not checked here (and will give rise to a compile time warning only). Preferably uses names instead of numbers in your code since the numbering depends an the inclusions and may differ at different compiles. Substitution of the numbers is done at compile time and does not require code. Cannot be used in preprocessor statements.

preBitIsClr: Test if a bit on a particular place is cleared.
#define preBitIsClr(p,q)
Use this to quickly test if a bit is cleared on a location (0..7). On the AVR this is compiled to a atomic test if possible.

preBitIsSet: Test if a bit on a particular place is set.
#define preBitIsSet(p,q)
Use this to quickly test if a bit is set on a location (0..7). On the AVR this is compiled to a atomic test if possible.

preMutexDefined: Use to see if a mutex is defined on a slot name.
#define preMutexDefined(SlotName)
Use this function to see if a mutex is defined on a slot name. Can be used in preproccessor statements

preQueuDefined: Use to see if a queu is defined on a slot name.
#define preQueuDefined(SlotName)
Use this function to see if a queu is defined on a slot name. Can be used in preproccessor statements

preBitSet: Use this function as general bit setter.
#define preBitSet1(p,n0)
#define preBitSet2(p,n0,n1)
#define preBitSet3(p,n0,n1,n2)
#define preBitSet4(p,n0,n1,n2,n3)
#define preBitSet5(p,n0,n1,n2,n3,n4)
#define preBitSet6(p,n0,n1,n2,n3,n4,n5)
#define preBitSet7(p,n0,n1,n2,n3,n4,n5,n6)
#define preBitSet8(p,n0,n1,n2,n3,n4,n5,n6,n7)
Use this function to set a one or more bits on a variable, or to modify one or more bits on a variable. For the AVR, if you use something like PORTA = preBitSet1(PORTA,3), it is compiled to an atomic instruction. The method is used internally since it can also deal with the cfgUndefined constant (which is ignored).
     Note: n0 .. n7 should be constants and not variables.

preSlotDefined: Use to see if a slot is in use.
#define preSlotDefined(SlotName)
Use this function to see if a slot is in use. Can be used in preproccessor statements

preSlotNumberOf: Returns the slot number of a slot with the name "SlotName".
#define preSlotNumberOf(SlotName)
Using this function it is possible to use static names for the slots instead of numbers. It returns the slot number of a slot with the compile time name "SlotName". This function is implicitly called in all 'OnName' variants of the API calls. Make sure you correctly spell the name, since that is not checked here (and will give rise to a compile time warning only). Preferably uses names instead of numbers in your code since the numbering depends an the inclusions and may differ at different compiles. Substitution of the numbers is done at compile time and does not require code. Cannot be used in preprocessor statements.

preTaskDefined: Use to see if a task is defined and included in the source
#define preTaskDefined(TaskName)
Use this function to see if a task is defined and included in the source Can be used in preproccessor statements

preTaskNumberOf: Returns the task number of a task with the name "TaskName".
#define preTaskNumberOf(TaskName)
Using this function it is possible to use static names for the tasks instead of numbers. It returns the task number of a task with the compile time name "TaskName". This does not equal the task name that is embedded in the code, that may be different or even absent). This function is implicitly called in all 'OnName' variants of the API calls. Make sure you correctly spell the name, since that is not checked here (and will give rise to a compile time warning only). Preferably uses names instead of numbers in your code since the numbering depends an the inclusions and may differ at different compiles. Substitution of the numbers is done at compile time and does not require code. Cannot be used in preprocessor statements.

preWaitDefined: Use this function to see if a wait is defined on a slot name.
#define preWaitDefined(SlotName)
Use this function to see if a wait is defined on a slot name. Can be used in preproccessor statements

defRestartSuspended: Literal value to restart a task in the suspended state.
#define defRestartSuspended
Use this value as restartMode when calling taskRestart(). It restarts the task, and makes sure it starts suspended. This value overrides the value given in the configuration. For tasks with a shared stack, this causes the task to start in a shared state, passing execution on to to the next task with shared stack. Note that the shared stack is not rescheduled any more until resume is called on this stack. Effectively the task is temporarily taken out of the pool of tasks with shared stacks.

defRestartSleeping: Literal value to restart a task in the sleeping state.
#define defRestartSleeping
Use this value as restartMode when calling taskRestart(). It puts the task to sleep. Restart only takes place after the device has slept. This value overrides the value given in the configuration. For tasks with a shared stack, this causes the task to start in a shared state, passing execution on to to the next task with shared stack. Note that the shared stack is not rescheduled any more until the device has slept. Effectively the task is temporarily taken out of the pool of tasks with shared stacks.

defRestartDefault: Literal value to restart a task in the default state.
#define defRestartDefault
Use this value as restartMode when calling taskRestart(). It puts the task in the start mode as defined in the configuration. For tasks with a shared stack, this causes the task to start in a shared state, passing execution on to to the next task with shared stack. The result thus depends on the setting being cfgStartRunning, cfgStartSuspended of cgfStartSleeping.

defRestartRunning: Literal value to restart a task in the running state.
#define defRestartRunning
Use this value as restartMode when calling taskRestart(). It restarts the task, and makes sure it starts running. This value overrides the value given in the configuration. For tasks with a shared stack, this causes the task to start in a shared state, passing execution on to to the next task with shared stack.

defSuspendNow: Literal value to suspend a task directly
#define defSuspendNow
Use this value in taskSuspend() as suspendMode. It will suspend the task immediately. If, at the same time, there was a suspend request present, that will be reset.

defSuspendCheck: Literal value to check for a suspend request.
#define defSuspendCheck
Use this value in taskSuspend() to check if there is a suspend request present. If so, the task will suspend at this point, and the request will be 'consumed'.

defSuspendClear: Literal value to reset a suspend request and continue.
#define defSuspendClear
Use this value in taskSuspend() to check if there is a suspend request present. If so, the task will consume the request, but will not suspend.

Contact: info@femtoos.org   CC-BY License: Ruud Vlaming.