Skip to content

Commit 6a4f749

Browse files
committed
reset ota module on every vm run
1 parent 07015ad commit 6a4f749

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

ports/esp32s2/common-hal/ota/__init__.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* THE SOFTWARE.
2525
*/
2626

27+
#include "common-hal/ota/__init__.h"
2728
#include "shared-bindings/ota/__init__.h"
2829

2930
#include <string.h>
@@ -37,7 +38,7 @@ static esp_ota_handle_t update_handle = 0;
3738
static bool ota_inited = false;
3839
static const char *TAG = "OTA";
3940

40-
static void ota_reset(void) {
41+
void ota_reset(void) {
4142
update_handle = 0;
4243
update_partition = NULL;
4344
ota_inited = false;

ports/esp32s2/common-hal/ota/__init__.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
* THE SOFTWARE.
2525
*/
2626

27-
#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_OTA__INIT__H
28-
#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_OTA__INIT__H
27+
#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_OTA___INIT___H
28+
#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_OTA___INIT___H
2929

3030
extern void ota_reset(void);
3131

32-
#endif //MICROPY_INCLUDED_ESP32S2_COMMON_HAL_OTA__INIT__H
32+
#endif //MICROPY_INCLUDED_ESP32S2_COMMON_HAL_OTA___INIT___H

ports/esp32s2/supervisor/port.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include "common-hal/busio/I2C.h"
4242
#include "common-hal/busio/SPI.h"
4343
#include "common-hal/busio/UART.h"
44+
#include "common-hal/ota/__init__.h"
4445
#include "common-hal/ps2io/Ps2.h"
4546
#include "common-hal/pulseio/PulseIn.h"
4647
#include "common-hal/pwmio/PWMOut.h"
@@ -107,6 +108,10 @@ void reset_port(void) {
107108
analogout_reset();
108109
#endif
109110

111+
#if CIRCUITPY_OTA
112+
ota_reset();
113+
#endif
114+
110115
#if CIRCUITPY_PS2IO
111116
ps2_reset();
112117
#endif

0 commit comments

Comments
 (0)