QuickStart Library Specific Code Block |
---|
language | cpp |
---|
title | dn_time.h |
---|
| uint32_t dn_time_ms(void):
void dn_sleep_ms(uint32_t milliseconds); |
These functions allows the QSL to perform timing, schedule tasks and sleep to save power. - time_ms: Simply needs to return time in milliseconds. The absolute value is irrelevant; as long as the time returned from subsequent calls will differ by the actual time passed between them.
- sleep_ms: Make the CPU sleep for the set number of milliseconds. If power consumption is not a big concern, a simple an alternative is to just simply add a delay instead.
Warning |
---|
Make sure time_ms counts to the full 32 bit range (i.e. up to 4294967295 or 0xFFFFFFFF) before it wraps around to ensure correct behaviour; the QSL will trigger a timeout too early if it is scheduled right before an unexpected wrap around. |
Code Block |
---|
language | cpp |
---|
title | dn_watchdog.h |
---|
| void dn_watchdog_feed(void); |
This function allows the QSL to make sure any watchdog in the user application is fed during processes that can take some time (e.g. searching for a network).
- watchdog_feed: Feed any watchdog that might be implemented in the platform; simply use stub function if none.
|