- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm working with 20706 and WICED studio 6. For our application we need to rely on the timer to track events.
Looking at the API and examples, here are some questions:
1) Functions like wiced_init_timer(), wiced_start_timer() and wiced_stop_timer() all return wiced_result_t, which might not be WICED_SUCCESS. Can they actually fail? Why would they fail? How do I recover from the failure? If any of them fails, I'm left in a very awkward position, and without knowing more, the only logical thing left to do is reset the system...
2) Would starting a timer affect system sleep? Does the type of the timer matter (periodic vs. one-shot, ms vs. s)?
3) Are there any timing constraints on timer callbacks? How long can my callback function run without breaking the system?
Thanks!
Solved! Go to Solution.
- Tags:
- teaser
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1) a) wiced_init_timer will return WICED_ERROR if wiced_timer_t* or wiced_timer_callback_t parameters are NULL.
b) The start_timer will return WICED_BADARG if you do not specify a timeout value.
These APIs shouldn't fail if all the parameters that are passed are correct (value and format).
2) Yes, if there is a timer running, then the device won't go to sleep till the timer is stopped.
3) I don't think we have quantified this number.
4) No, timer callbacks are not called in an ISR. Yes, many callbacks are called from an ISR.
5) No, callbacks cannot preempt each other.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quick follow up question:
The timer callbacks are not called in an Interrupt Service Routine, correct? Are any callbacks like rx data callback called in an ISR?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Slight panic here: Can callbacks of different types preempt each other?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1) a) wiced_init_timer will return WICED_ERROR if wiced_timer_t* or wiced_timer_callback_t parameters are NULL.
b) The start_timer will return WICED_BADARG if you do not specify a timeout value.
These APIs shouldn't fail if all the parameters that are passed are correct (value and format).
2) Yes, if there is a timer running, then the device won't go to sleep till the timer is stopped.
3) I don't think we have quantified this number.
4) No, timer callbacks are not called in an ISR. Yes, many callbacks are called from an ISR.
5) No, callbacks cannot preempt each other.