- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In my application, I use a CYW20736S and I need to implement a state machine. I have many GPIOs, UART, BLE, timer ... and multiple modes of user cases.
I know it's not possible to have a main() loop because this is a multi-threaded system and the architecture of the application is designed to be an event-driven system. Is there a way to implement a state machine?
I use this timer to count 5ms and to do some stuff (button, output switching, periodics data transmission in uart...):
bt_clock_based_periodic_timer_Enable(application_timer_expired_callback, NULL, 5000/625); // 5ms
I would like to use the fine timer for my state machine. Is it possible to use this one in addition to the previous?
I would like to know how many times I can stay on the fine timer interrupt? If it's possible, can I receive BLE notifications, UARTdata or 5ms timer interruption asynchronously during a fine timer interrupt? Do you think it's possible to do many instructions in a fine timer interrupt without problems (watchdog interrupt? stacking interrupts?). Is there a way to configure priority interruptions between UART, timer, BLE notification?
Thanks,
Solved! Go to Solution.
- Labels:
-
Timers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the help.
Do you have answer about the second part of my question ( time stay on the interrupts and consequences) ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is OK to do these things in the timer callback. The lower level uses tasks for different operation.