Skip to content

Commit f8e5e2d

Browse files
committed
Start on nRF nvm.ByteArray adafruit#1042 (doesn't do anything yet)
1 parent 5015036 commit f8e5e2d

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

5656
#define CIRCUITPY_AUTORELOAD_DELAY_MS 500
5757

58-
// TODO #define CIRCUITPY_INTERNAL_NVM_SIZE 8192
58+
#define CIRCUITPY_INTERNAL_NVM_SIZE (4096)
5959

6060
#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE)
6161

ports/nrf/common-hal/microcontroller/__init__.c

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

27+
#include "py/mphal.h"
28+
#include "py/obj.h"
29+
#include "py/runtime.h"
30+
2731
#include "common-hal/microcontroller/Pin.h"
2832
#include "common-hal/microcontroller/Processor.h"
2933

34+
#include "shared-bindings/nvm/ByteArray.h"
3035
#include "shared-bindings/microcontroller/__init__.h"
3136
#include "shared-bindings/microcontroller/Pin.h"
3237
#include "shared-bindings/microcontroller/Processor.h"
@@ -63,6 +68,17 @@ const mcu_processor_obj_t common_hal_mcu_processor_obj = {
6368
},
6469
};
6570

71+
#if CIRCUITPY_INTERNAL_NVM_SIZE > 0
72+
// The singleton nvm.ByteArray object.
73+
const nvm_bytearray_obj_t common_hal_mcu_nvm_obj = {
74+
.base = {
75+
.type = &nvm_bytearray_type,
76+
},
77+
.len = CIRCUITPY_INTERNAL_NVM_SIZE,
78+
.start_address = 0
79+
};
80+
#endif
81+
6682

6783
STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = {
6884
{ MP_ROM_QSTR(MP_QSTR_P0_00), MP_ROM_PTR(&pin_P0_00) },

0 commit comments

Comments
 (0)