[FL-3846] Event Loop Timers (#3721)

* Implement POC event loop tmers (not all edge cases are handled)
* Use a separate ready list to allow for (re)starting and stopping of timers from callback
* Improve the test application
* Improve timer API and test application
* Improve timeout calculation logic
* Improve timer API, update documentation
* Fix API usage error
* Update doxygen comments
* Revert the old (correct) check
* Improve function naming
* Check whether a timer was on the expired list before processing it
* Implement tick callback
* Add critical sections to improve timer consistency
* Simplify event loop timer API
* Remove redundant search
* Refactor timer logic, use message queue
* Simplify FuriEventLoopTimer API
* Improve event loop timer logic
* Update the f18 target
* Remove superfluous clears
* Correct f18 api symbols
* Fix doxygen comments
* Update .pvsconfig
* Use a double push list instead of deque
* Update .pvsconfig
* Add pending callback functionality
* Restore unprocessed flags when applicable
* Refactor Dolphin app to use FuriEventLoop
* Improve naming
* Update naming some more
* Fix a typo Co-authored-by: Silent <CookiePLMonster@users.noreply.github.com>
* Fix wait time in example
* Bump API version
* Debug: multiple of 25 timings in event loop blink test
* Separate FuriEventLoopTimer to its own set of files
* Improve start time calculation for periodic timers
* Do not use dynamic allocations for timer requests
* Split the tick functionality in separate files, rearrange code
* Improve timer queue handling
* Properly reset GPIO pins in the test app
* Properly initialise GPIO pins in the test app too
* Furi: variable naming in event loop
* Furi: fix spelling in event loop

Co-authored-by: あく <alleteam@gmail.com>
Co-authored-by: Silent <CookiePLMonster@users.noreply.github.com>
This commit is contained in:
Georgii Surkov
2024-07-02 15:09:50 +03:00
committed by GitHub
parent bf90843f25
commit 139660d206
20 changed files with 1087 additions and 256 deletions

View File

@@ -1,5 +1,5 @@
entry,status,name,type,params
Version,+,67.1,,
Version,+,67.2,,
Header,+,applications/services/bt/bt_service/bt.h,,
Header,+,applications/services/bt/bt_service/bt_keys_storage.h,,
Header,+,applications/services/cli/cli.h,,
@@ -1105,13 +1105,22 @@ Function,+,furi_event_flag_free,void,FuriEventFlag*
Function,+,furi_event_flag_get,uint32_t,FuriEventFlag*
Function,+,furi_event_flag_set,uint32_t,"FuriEventFlag*, uint32_t"
Function,+,furi_event_flag_wait,uint32_t,"FuriEventFlag*, uint32_t, uint32_t, uint32_t"
Function,-,furi_event_loop_alloc,FuriEventLoop*,
Function,-,furi_event_loop_free,void,FuriEventLoop*
Function,-,furi_event_loop_message_queue_subscribe,void,"FuriEventLoop*, FuriMessageQueue*, FuriEventLoopEvent, FuriEventLoopMessageQueueCallback, void*"
Function,-,furi_event_loop_message_queue_unsubscribe,void,"FuriEventLoop*, FuriMessageQueue*"
Function,-,furi_event_loop_run,void,FuriEventLoop*
Function,-,furi_event_loop_stop,void,FuriEventLoop*
Function,-,furi_event_loop_tick_set,void,"FuriEventLoop*, uint32_t, FuriEventLoopTickCallback, void*"
Function,+,furi_event_loop_alloc,FuriEventLoop*,
Function,+,furi_event_loop_free,void,FuriEventLoop*
Function,+,furi_event_loop_message_queue_subscribe,void,"FuriEventLoop*, FuriMessageQueue*, FuriEventLoopEvent, FuriEventLoopMessageQueueCallback, void*"
Function,+,furi_event_loop_message_queue_unsubscribe,void,"FuriEventLoop*, FuriMessageQueue*"
Function,+,furi_event_loop_pend_callback,void,"FuriEventLoop*, FuriEventLoopPendingCallback, void*"
Function,+,furi_event_loop_run,void,FuriEventLoop*
Function,+,furi_event_loop_stop,void,FuriEventLoop*
Function,+,furi_event_loop_tick_set,void,"FuriEventLoop*, uint32_t, FuriEventLoopTickCallback, void*"
Function,+,furi_event_loop_timer_alloc,FuriEventLoopTimer*,"FuriEventLoop*, FuriEventLoopTimerCallback, FuriEventLoopTimerType, void*"
Function,+,furi_event_loop_timer_free,void,FuriEventLoopTimer*
Function,+,furi_event_loop_timer_get_interval,uint32_t,const FuriEventLoopTimer*
Function,+,furi_event_loop_timer_get_remaining_time,uint32_t,const FuriEventLoopTimer*
Function,+,furi_event_loop_timer_is_running,_Bool,const FuriEventLoopTimer*
Function,+,furi_event_loop_timer_restart,void,FuriEventLoopTimer*
Function,+,furi_event_loop_timer_start,void,"FuriEventLoopTimer*, uint32_t"
Function,+,furi_event_loop_timer_stop,void,FuriEventLoopTimer*
Function,+,furi_get_tick,uint32_t,
Function,+,furi_hal_adc_acquire,FuriHalAdcHandle*,
Function,+,furi_hal_adc_configure,void,FuriHalAdcHandle*
1 entry status name type params
2 Version + 67.1 67.2
3 Header + applications/services/bt/bt_service/bt.h
4 Header + applications/services/bt/bt_service/bt_keys_storage.h
5 Header + applications/services/cli/cli.h
1105 Function + furi_event_flag_get uint32_t FuriEventFlag*
1106 Function + furi_event_flag_set uint32_t FuriEventFlag*, uint32_t
1107 Function + furi_event_flag_wait uint32_t FuriEventFlag*, uint32_t, uint32_t, uint32_t
1108 Function - + furi_event_loop_alloc FuriEventLoop*
1109 Function - + furi_event_loop_free void FuriEventLoop*
1110 Function - + furi_event_loop_message_queue_subscribe void FuriEventLoop*, FuriMessageQueue*, FuriEventLoopEvent, FuriEventLoopMessageQueueCallback, void*
1111 Function - + furi_event_loop_message_queue_unsubscribe void FuriEventLoop*, FuriMessageQueue*
1112 Function - + furi_event_loop_run furi_event_loop_pend_callback void FuriEventLoop* FuriEventLoop*, FuriEventLoopPendingCallback, void*
1113 Function - + furi_event_loop_stop furi_event_loop_run void FuriEventLoop*
1114 Function - + furi_event_loop_tick_set furi_event_loop_stop void FuriEventLoop*, uint32_t, FuriEventLoopTickCallback, void* FuriEventLoop*
1115 Function + furi_event_loop_tick_set void FuriEventLoop*, uint32_t, FuriEventLoopTickCallback, void*
1116 Function + furi_event_loop_timer_alloc FuriEventLoopTimer* FuriEventLoop*, FuriEventLoopTimerCallback, FuriEventLoopTimerType, void*
1117 Function + furi_event_loop_timer_free void FuriEventLoopTimer*
1118 Function + furi_event_loop_timer_get_interval uint32_t const FuriEventLoopTimer*
1119 Function + furi_event_loop_timer_get_remaining_time uint32_t const FuriEventLoopTimer*
1120 Function + furi_event_loop_timer_is_running _Bool const FuriEventLoopTimer*
1121 Function + furi_event_loop_timer_restart void FuriEventLoopTimer*
1122 Function + furi_event_loop_timer_start void FuriEventLoopTimer*, uint32_t
1123 Function + furi_event_loop_timer_stop void FuriEventLoopTimer*
1124 Function + furi_get_tick uint32_t
1125 Function + furi_hal_adc_acquire FuriHalAdcHandle*
1126 Function + furi_hal_adc_configure void FuriHalAdcHandle*