diff --git a/app/app.c b/app/app.c index 3d53dbe..d1e06b9 100644 --- a/app/app.c +++ b/app/app.c @@ -1838,6 +1838,39 @@ void APP_process_transmit(void) } } +void APP_process_functions(void) +{ + switch (g_current_function) + { + case FUNCTION_FOREGROUND: + APP_check_for_new_receive(); + break; + + case FUNCTION_TRANSMIT: + if (g_setting_backlight_on_tx_rx == 1 || g_setting_backlight_on_tx_rx == 3) + backlight_turn_on(backlight_tx_rx_time_500ms); + break; + + case FUNCTION_NEW_RECEIVE: + APP_process_new_receive(); + + case FUNCTION_MONITOR: + break; + + case FUNCTION_RECEIVE: + APP_process_rx(); + break; + + case FUNCTION_POWER_SAVE: + if (!g_rx_idle_mode) + APP_check_for_new_receive(); + break; + + case FUNCTION_PANADAPTER: + break; + } +} + void APP_process_power_save(void) { if (g_schedule_power_save) @@ -2413,20 +2446,7 @@ void APP_time_slice_10ms(void) GUI_SelectNextDisplay(DISPLAY_MAIN); } - #ifdef ENABLE_BOOT_BEEPS - if (g_boot_counter_10ms > 0 && (g_boot_counter_10ms % 25) == 0) - AUDIO_PlayBeep(BEEP_880HZ_40MS_OPTIONAL); - #endif - - #ifdef ENABLE_VOICE - if (g_flag_play_queued_voice) - { - g_flag_play_queued_voice = false; - AUDIO_PlayQueuedVoice(); - } - #endif - - if (g_reduced_service) + if (g_reduced_service || g_serial_config_tick_500ms > 0) { if (g_current_function == FUNCTION_TRANSMIT) g_tx_timeout_reached = true; @@ -2445,6 +2465,8 @@ void APP_time_slice_10ms(void) if (g_current_function != FUNCTION_POWER_SAVE || !g_rx_idle_mode) APP_process_radio_interrupts(); + APP_process_functions(); + if (g_current_function == FUNCTION_TRANSMIT) { // transmitting #ifdef ENABLE_TX_AUDIO_BAR @@ -2453,6 +2475,19 @@ void APP_time_slice_10ms(void) #endif } + #ifdef ENABLE_BOOT_BEEPS + if (g_boot_counter_10ms > 0 && (g_boot_counter_10ms % 25) == 0) + AUDIO_PlayBeep(BEEP_880HZ_40MS_OPTIONAL); + #endif + + #ifdef ENABLE_VOICE + if (g_flag_play_queued_voice) + { + g_flag_play_queued_voice = false; + AUDIO_PlayQueuedVoice(); + } + #endif + if (g_update_display) GUI_DisplayScreen(); @@ -2474,8 +2509,27 @@ void APP_time_slice_10ms(void) g_vox_pause_count_down--; #endif + #ifdef ENABLE_VOX + if (g_eeprom.vox_switch) + APP_process_vox(); + #endif + APP_process_transmit(); + #ifdef ENABLE_FMRADIO + if (g_schedule_fm && + g_fm_scan_state != FM_SCAN_OFF && + g_current_function != FUNCTION_MONITOR && + g_current_function != FUNCTION_RECEIVE && + g_current_function != FUNCTION_TRANSMIT) + { // switch to FM radio mode + FM_Play(); + g_schedule_fm = false; + } + #endif + + APP_process_power_save(); + #ifdef ENABLE_FMRADIO if (g_fm_radio_mode && g_fm_restore_tick_10ms > 0) { @@ -2494,66 +2548,6 @@ void APP_time_slice_10ms(void) APP_check_keys(); } -void APP_process(void) -{ - if (g_reduced_service || g_serial_config_tick_500ms > 0) - return; - - switch (g_current_function) - { - case FUNCTION_FOREGROUND: - APP_check_for_new_receive(); - break; - - case FUNCTION_TRANSMIT: - if (g_setting_backlight_on_tx_rx == 1 || g_setting_backlight_on_tx_rx == 3) - backlight_turn_on(backlight_tx_rx_time_500ms); - break; - - case FUNCTION_NEW_RECEIVE: - APP_process_new_receive(); - - case FUNCTION_MONITOR: - break; - - case FUNCTION_RECEIVE: - APP_process_rx(); - break; - - case FUNCTION_POWER_SAVE: - if (!g_rx_idle_mode) - APP_check_for_new_receive(); - break; - - case FUNCTION_PANADAPTER: - break; - } - - #ifdef ENABLE_FMRADIO - if (g_fm_radio_mode && g_fm_radio_tick_500ms > 0) - return; - #endif - - #ifdef ENABLE_VOX - if (g_eeprom.vox_switch) - APP_process_vox(); - #endif - -#ifdef ENABLE_FMRADIO - if (g_schedule_fm && - g_fm_scan_state != FM_SCAN_OFF && - g_current_function != FUNCTION_MONITOR && - g_current_function != FUNCTION_RECEIVE && - g_current_function != FUNCTION_TRANSMIT) - { // switch to FM radio mode - FM_Play(); - g_schedule_fm = false; - } -#endif - - APP_process_power_save(); -} - static void APP_process_key(const key_code_t Key, const bool key_pressed, const bool key_held) { bool flag = false; diff --git a/app/app.h b/app/app.h index 615b8a9..7167282 100644 --- a/app/app.h +++ b/app/app.h @@ -33,7 +33,6 @@ void APP_stop_scan(void); void APP_channel_next(const bool remember_current, const scan_state_dir_t scan_direction); bool APP_start_listening(function_type_t Function); uint32_t APP_set_frequency_by_step(vfo_info_t *pInfo, int8_t Step); -void APP_process(void); void APP_time_slice_10ms(void); void APP_time_slice_500ms(void); diff --git a/firmware.bin b/firmware.bin index 4763a0d..338871a 100644 Binary files a/firmware.bin and b/firmware.bin differ diff --git a/firmware.packed.bin b/firmware.packed.bin index d0cd0ef..1ec9458 100644 Binary files a/firmware.packed.bin and b/firmware.packed.bin differ diff --git a/main.c b/main.c index d5d15cc..13bcd30 100644 --- a/main.c +++ b/main.c @@ -242,7 +242,7 @@ void Main(void) while (1) { - #if 0 + #if 1 // Mask interrupts __asm volatile ("cpsid i"); if (!g_next_time_slice) @@ -253,8 +253,6 @@ void Main(void) __asm volatile ("cpsie i"); #endif - APP_process(); - if (g_next_time_slice) { APP_time_slice_10ms();