diff --git a/firmware/components/buzzer/buzzer.c b/firmware/components/buzzer/buzzer.c index aaf7c66..4892e36 100644 --- a/firmware/components/buzzer/buzzer.c +++ b/firmware/components/buzzer/buzzer.c @@ -104,9 +104,9 @@ void buzzer_play_for_task(void* duration) { return; #endif - uint32_t dur = *(uint32_t*) duration; + uint32_t dur = (uint32_t) duration; buzzer_play(); - vTaskDelay(*(uint32_t*) duration / portTICK_PERIOD_MS); + vTaskDelay(dur / portTICK_PERIOD_MS); buzzer_stop(); vTaskDelete(NULL); } @@ -119,10 +119,8 @@ void buzzer_play_for(uint32_t duration) { if (!buzzer.enabled) { return; } - uint32_t* duration_ptr = malloc(sizeof(uint32_t)); - *duration_ptr = duration; - xTaskCreate(buzzer_play_for_task, "buzzer_play_for_task", 2048, duration_ptr, - 5, NULL); + xTaskCreate(buzzer_play_for_task, "buzzer_play_for_task", 2048, + (void*) duration, 5, NULL); } void buzzer_stop() { diff --git a/firmware/main/general/general_screens.c b/firmware/main/general/general_screens.c index 4394400..491b3d0 100644 --- a/firmware/main/general/general_screens.c +++ b/firmware/main/general/general_screens.c @@ -146,10 +146,16 @@ static void general_screen_display_scrolling() { } for (uint16_t i = scrolling_option; i < end_index; i++) { - oled_screen_display_text( - scrolling_menu_ctx->menu_items[i], 3, - (i - scrolling_option) + (ITEMOFFSET + screen_title), - OLED_DISPLAY_NORMAL); + if (i == scrolling_option) { + general_screen_display_selected_item( + scrolling_menu_ctx->menu_items[i], + (i - scrolling_option) + (ITEMOFFSET + screen_title)); + } else { + oled_screen_display_text( + scrolling_menu_ctx->menu_items[i], 3, + (i - scrolling_option) + (ITEMOFFSET + screen_title), + OLED_DISPLAY_NORMAL); + } } oled_screen_display_show(); }