SWRA667 January 2020 CC1312PSIP , CC1312R , CC1314R10 , CC1352P , CC1352P7 , CC1352R , CC1354P10 , CC1354R10 , CC2642R , CC2642R-Q1 , CC2652P , CC2652R , CC2652R7 , CC2652RB , CC2652RSIP
We use overhead to describe the CPU cycles spent over the course of an operation on anything that is not directly related to configuring the hardware or returning to the original calling context.
Polling return behavior has the least overhead. This is because its implementations are the closest to bare-metal we can provide. Apart from acquiring the mutex protecting the hardware from concurrent access, there are no OS calls and interrupts are avoided when hardware flags are available. How this affects power and call duration depends on how computationally expensive the operation is.
Callback return behavior has more inherent overhead. It requires the handling of an asynchronous event. That means that at least one context switch is required to handle the asynchronous event.
Blocking return behavior is effectively a specialized case of callback return behavior in terms of overhead. It will always post a semaphore and unblock a pending Task when the asynchronous event triggers.
If the power driver puts the device into idle when using callback or blocking return behavior, that comes with the associated overhead of going into and coming out of idle.
Return Behavior | Overhead |
---|---|
Polling | Low |
Callback | Medium-High |
Blocking | High |