Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Panel

C Library Specific

Refer to the dustcloud C Library documentation for further details on how to port the prototypes in these headers.

Panel

QuickStart Library Specific

Code Block
languagecpp
titledn_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 (or simply delay) for the set number of milliseconds.
 
  • . If power consumption is not a big concern, an alternative is to simply add a delay.
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
languagecpp
titledn_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.