File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 3232static const esp_spp_sec_t sec_mask = ESP_SPP_SEC_AUTHENTICATE ;
3333static const esp_spp_role_t role_slave = ESP_SPP_ROLE_SLAVE ;
3434
35+ static uint8_t vfx_prev_mode = 0 ;
3536static uint8_t ota_running = 0 ;
3637static long image_length = 0 ;
3738static long data_recv = 0 ;
@@ -80,6 +81,8 @@ void bt_app_spp_cb(esp_spp_cb_event_t event, esp_spp_cb_param_t *param)
8081
8182 ota_running = 0 ;
8283 image_length = 0 ;
84+
85+ vfx_set_mode (vfx_prev_mode );
8386 }
8487
8588 led_set_mode (3 );
@@ -108,6 +111,9 @@ void bt_app_spp_cb(esp_spp_cb_event_t event, esp_spp_cb_param_t *param)
108111
109112 EventBits_t uxBits = xEventGroupGetBits (user_event_group );
110113 if (image_length != 0 && !(uxBits & BT_OTA_LOCKED_BIT )) {
114+ vfx_prev_mode = vfx_get_mode ();
115+ vfx_set_mode (0 );
116+
111117 ota_running = 1 ;
112118
113119 update_partition = esp_ota_get_next_update_partition (NULL );
@@ -159,16 +165,17 @@ void bt_app_spp_cb(esp_spp_cb_event_t event, esp_spp_cb_param_t *param)
159165
160166 esp_spp_write (param -> write .handle , strlen (rsp_str [1 ]), (uint8_t * )rsp_str [1 ]);
161167
162- ota_running = 0 ;
163- image_length = 0 ;
168+ goto exit ;
164169 } else if (data_recv > image_length ) {
165170err1 :
166171 esp_ota_end (update_handle );
167172err0 :
168173 esp_spp_write (param -> write .handle , strlen (rsp_str [2 ]), (uint8_t * )rsp_str [2 ]);
169-
174+ exit :
170175 ota_running = 0 ;
171176 image_length = 0 ;
177+
178+ vfx_set_mode (vfx_prev_mode );
172179 }
173180 }
174181 break ;
You can’t perform that action at this time.
0 commit comments