mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-13 05:06:30 +04:00
Furi, FuriHal: remove FreeRTOS headers leaks (#3179)
* Furi: remove direct FreeRTOS timers use * Furi: eliminate FreeRTOS headers leak. What did it cost? Everything... * SubGhz: proper public api for protocols. Format Sources. * Furi: slightly less redundant declarations * Desktop: proper types in printf * Sync API Symbols * Furi: add timer reset and fix dolphin service, fix unit tests * Furi: proper timer restart method naming and correct behavior in timer stopped state. --------- Co-authored-by: hedger <hedger@nanode.su>
This commit is contained in:
@@ -6,20 +6,6 @@
|
||||
|
||||
static Input* input = NULL;
|
||||
|
||||
inline static void input_timer_start(FuriTimer* timer_id, uint32_t ticks) {
|
||||
TimerHandle_t hTimer = (TimerHandle_t)timer_id;
|
||||
furi_check(xTimerChangePeriod(hTimer, ticks, portMAX_DELAY) == pdPASS);
|
||||
}
|
||||
|
||||
inline static void input_timer_stop(FuriTimer* timer_id) {
|
||||
TimerHandle_t hTimer = (TimerHandle_t)timer_id;
|
||||
furi_check(xTimerStop(hTimer, portMAX_DELAY) == pdPASS);
|
||||
// xTimerStop is not actually stopping timer,
|
||||
// Instead it places stop event into timer queue
|
||||
// This code ensures that timer is stopped
|
||||
while(xTimerIsTimerActive(hTimer) == pdTRUE) furi_delay_tick(1);
|
||||
}
|
||||
|
||||
void input_press_timer_callback(void* arg) {
|
||||
InputPinState* input_pin = arg;
|
||||
InputEvent event;
|
||||
@@ -123,10 +109,12 @@ int32_t input_srv(void* p) {
|
||||
input->counter++;
|
||||
input->pin_states[i].counter = input->counter;
|
||||
event.sequence_counter = input->pin_states[i].counter;
|
||||
input_timer_start(input->pin_states[i].press_timer, INPUT_PRESS_TICKS);
|
||||
furi_timer_start(input->pin_states[i].press_timer, INPUT_PRESS_TICKS);
|
||||
} else {
|
||||
event.sequence_counter = input->pin_states[i].counter;
|
||||
input_timer_stop(input->pin_states[i].press_timer);
|
||||
furi_timer_stop(input->pin_states[i].press_timer);
|
||||
while(furi_timer_is_running(input->pin_states[i].press_timer))
|
||||
furi_delay_tick(1);
|
||||
if(input->pin_states[i].press_counter < INPUT_LONG_PRESS_COUNTS) {
|
||||
event.type = InputTypeShort;
|
||||
furi_pubsub_publish(input->event_pubsub, &event);
|
||||
|
||||
Reference in New Issue
Block a user