File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
ports/raspberrypi/common-hal/nvm Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change 31
31
32
32
#include "py/runtime.h"
33
33
#include "src/rp2_common/hardware_flash/include/hardware/flash.h"
34
+ #include "shared-bindings/microcontroller/__init__.h"
34
35
35
36
extern uint32_t __flash_binary_start ;
36
37
static const uint32_t flash_binary_start = (uint32_t )& __flash_binary_start ;
@@ -71,6 +72,8 @@ void common_hal_nvm_bytearray_get_bytes(const nvm_bytearray_obj_t *self,
71
72
72
73
bool common_hal_nvm_bytearray_set_bytes (const nvm_bytearray_obj_t * self ,
73
74
uint32_t start_index , uint8_t * values , uint32_t len ) {
75
+ // disable interrupts to prevent core hang on rp2040
76
+ common_hal_mcu_disable_interrupts ();
74
77
uint8_t values_in [len ];
75
78
common_hal_nvm_bytearray_get_bytes (self , start_index , len , values_in );
76
79
@@ -99,5 +102,6 @@ bool common_hal_nvm_bytearray_set_bytes(const nvm_bytearray_obj_t *self,
99
102
erase_and_write_sector (start_index , len , values );
100
103
}
101
104
105
+ common_hal_mcu_enable_interrupts ();
102
106
return true;
103
107
}
You can’t perform that action at this time.
0 commit comments