#include <cs_port.h>
Link against: c32.lib
class CommTimer |
Public Member Functions | |
---|---|
CDeltaTimer * | GetTimer() |
IMPORT_C void | Queue(TTimeIntervalMicroSeconds32, TDeltaTimerEntry &) |
IMPORT_C void | Remove(TDeltaTimerEntry &) |
Static utility class for global timer handling designed for use by Serial Server plug-ins (CSYs).
CDeltaTimer * | GetTimer | ( | ) | [static] |
Get the pointer to the global timer. If it does not exist, create a new timer and store the pointer in the TLS.
Only clients within CSYs should use this API, since this function has a legacy behaviour of panicking in the case of no memory. This is due to the API not containing a means to communicate this result back to the caller. In the case where GetTimer is used by a CSY this is not a problem since the CSY will be running in a thread that C32 has already allocated the CommTimer memory for.
This function is using TLS (Thread Local Storage) and may reduce performance.
IMPORT_C void | Queue | ( | TTimeIntervalMicroSeconds32 | aTimeInMicroSeconds, |
TDeltaTimerEntry & | aHandle | |||
) | [static] |
Queue a timer on the global timer.
This class is only suitable for CSYs since it currently has no direct mechanism through which to release the Thread Local Storage and heap resources it allocates. In the case of CSYs these resources are managed separately by C32.
Note:
1. The Thread Local Storage of the calling thread must be available for use.
2. The first time this is called for a thread, a small amount of heap memory is required. If no memory is available, a "c32-fault" panic of type 7 is raised. Subsequent calls are not affected since they reuse this memory.
Parameters | |
---|---|
aTimeInMicroSeconds | the timeout value in micro seconds |
aHandle | handle to the delta timer entry |
IMPORT_C void | Remove | ( | TDeltaTimerEntry & | aHandle | ) | [static] |
Call cancel on the global timer
Note: This does not free the Thread Local Storage for the calling thread.
Parameters | |
---|---|
aHandle | the timer to cancel |