adaptive sync module
More...
adaptive sync module
- Author
- Tengfei Chang tengf.nosp@m.ei.c.nosp@m.hang@.nosp@m.eecs.nosp@m..berk.nosp@m.eley.nosp@m..edu, January 2014.
Enumerator |
---|
S_NONE |
|
S_FASTER |
|
S_SLOWER |
|
void adaptive_sync_calculateCompensatedSlots |
( |
int16_t |
timeCorrection | ) |
|
Calculate the compensation interval, in number of slots.
- Parameters
-
[in] | timeCorrection | time to be corrected |
- Returns
- compensationSlots the number of slots.
void adaptive_sync_countCompensationTimeout |
( |
void |
| ) |
|
update compensationTimeout at the beginning of each slot and adjust current slot length when the elapsed slots rearch to compensation interval.
Once compensationTimeout == 0, extend or shorten current slot length for one tick.
void adaptive_sync_countCompensationTimeout_compoundSlots |
( |
uint16_t |
compoundSlots | ) |
|
update compensationTimeout when compound slots are scheduled and adjust the slot when the elapsed slots rearch to compensation interval(e.g. SERIALRX slots)
- Parameters
-
[in] | compoundSlots | how many slots will be elapsed before wakeup next time. |
void adaptive_sync_driftChanged |
( |
void |
| ) |
|
set driftChanged to true.
void adaptive_sync_init |
( |
void |
| ) |
|
void adaptive_sync_preprocess |
( |
int16_t |
timeCorrection, |
|
|
open_addr_t |
timesource |
|
) |
| |
Calculated how many slots have elapsed since last synchronized.
- Parameters
-
[in] | timeCorrection | time to be corrected |
[in] | timesource | The address of neighbor. |
- Returns
- the number of slots