File tree Expand file tree Collapse file tree 2 files changed +6
-14
lines changed Expand file tree Collapse file tree 2 files changed +6
-14
lines changed Original file line number Diff line number Diff line change 109
109
110
110
#ifdef CIRCUITPY_BOOT_COUNTER
111
111
#include "shared-bindings/nvm/ByteArray.h"
112
+ uint8_t value_out = 0 ;
112
113
#endif
113
114
114
115
#if MICROPY_ENABLE_PYSTACK
@@ -308,15 +309,6 @@ STATIC void print_code_py_status_message(safe_mode_t safe_mode) {
308
309
}
309
310
}
310
311
311
- #ifdef CIRCUITPY_BOOT_COUNTER
312
- nvm_bytearray_obj_t bootcnt = {
313
- .base = {.type = & nvm_bytearray_type },
314
- .len = ( uint32_t ) 1 ,
315
- .start_address = (uint8_t * ) (0x00080000 - CIRCUITPY_INTERNAL_NVM_SIZE )
316
- };
317
- uint8_t value_out = 0 ;
318
- #endif
319
-
320
312
STATIC bool run_code_py (safe_mode_t safe_mode ) {
321
313
bool serial_connected_at_start = serial_connected ();
322
314
bool printed_safe_mode_message = false;
@@ -330,9 +322,9 @@ STATIC bool run_code_py(safe_mode_t safe_mode) {
330
322
#endif
331
323
332
324
#ifdef CIRCUITPY_BOOT_COUNTER
333
- common_hal_nvm_bytearray_get_bytes (& bootcnt ,0 ,1 ,& value_out );
325
+ common_hal_nvm_bytearray_get_bytes (& common_hal_mcu_nvm_obj ,0 ,1 ,& value_out );
334
326
++ value_out ;
335
- common_hal_nvm_bytearray_set_bytes (& bootcnt ,0 ,& value_out ,1 );
327
+ common_hal_nvm_bytearray_set_bytes (& common_hal_mcu_nvm_obj ,0 ,& value_out ,1 );
336
328
#endif
337
329
338
330
pyexec_result_t result ;
Original file line number Diff line number Diff line change 31
31
32
32
extern const mp_obj_type_t nvm_bytearray_type ;
33
33
34
- uint32_t common_hal_nvm_bytearray_get_length (nvm_bytearray_obj_t * self );
34
+ uint32_t common_hal_nvm_bytearray_get_length (const nvm_bytearray_obj_t * self );
35
35
36
- bool common_hal_nvm_bytearray_set_bytes (nvm_bytearray_obj_t * self ,
36
+ bool common_hal_nvm_bytearray_set_bytes (const nvm_bytearray_obj_t * self ,
37
37
uint32_t start_index , uint8_t * values , uint32_t len );
38
38
// len and values are intentionally swapped to signify values is an output and
39
39
// also leverage the compiler to validate uses are expected.
40
- void common_hal_nvm_bytearray_get_bytes (nvm_bytearray_obj_t * self ,
40
+ void common_hal_nvm_bytearray_get_bytes (const nvm_bytearray_obj_t * self ,
41
41
uint32_t start_index , uint32_t len , uint8_t * values );
42
42
43
43
#endif // MICROPY_INCLUDED_SHARED_BINDINGS_NVM_BYTEARRAY_H
You can’t perform that action at this time.
0 commit comments