Skip to content

Commit

Permalink
Merge pull request #438 from SumolX/dvr_resolution_race_condition
Browse files Browse the repository at this point in the history
Prevent recording race-condition when wifi is enabled
  • Loading branch information
ligenxxxx authored Aug 30, 2024
2 parents 406ad54 + ded1956 commit 9da68d9
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/ui/page_wifi.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,9 @@ static void page_wifi_mask_password(lv_obj_t *obj, int size) {

/**
* Update settings and apply them.
*
* Note: This function will be invoked asynchronously post bootup and may
* require additional APP_STATE checks to ensure integrity of execution.
*/
static void page_wifi_update_settings() {
g_setting.wifi.enable = btn_group_get_sel(&page_wifi.page_1.enable.button) == 0;
Expand Down Expand Up @@ -304,7 +307,9 @@ static void page_wifi_update_settings() {

// Activate WiFi interface
if (g_setting.wifi.enable) {
dvr_update_vi_conf(VR_1080P30);
if (g_app_state == APP_STATE_MAINMENU) {
dvr_update_vi_conf(VR_1080P30);
}
if (WIFI_MODE_AP == g_setting.wifi.mode) {
system_script(WIFI_AP_ON);
} else {
Expand Down Expand Up @@ -473,8 +478,8 @@ static void page_wifi_update_current_page(int which) {
lv_obj_clear_flag(page_wifi.page_2.gateway.input, LV_OBJ_FLAG_HIDDEN);

if (page_wifi.page_1.mode.button.current == WIFI_MODE_AP ||
(page_wifi.page_1.mode.button.current == WIFI_MODE_STA &&
page_wifi.page_2.dhcp.button.current == 1)) {
(page_wifi.page_1.mode.button.current == WIFI_MODE_STA &&
page_wifi.page_2.dhcp.button.current == 1)) {
lv_obj_clear_state(page_wifi.page_2.netmask.label, STATE_DISABLED);
lv_obj_clear_state(page_wifi.page_2.netmask.input, STATE_DISABLED);
lv_obj_clear_state(page_wifi.page_2.gateway.label, STATE_DISABLED);
Expand Down

0 comments on commit 9da68d9

Please sign in to comment.