Skip to content

Commit 7cbcc2f

Browse files
committed
updating pycubed board defs & including
1 parent 37bddec commit 7cbcc2f

File tree

10 files changed

+33
-45
lines changed

10 files changed

+33
-45
lines changed

ports/atmel-samd/boards/pycubed/board.c

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

27-
28-
#include <string.h>
29-
3027
#include "supervisor/board.h"
31-
#include "py/mpconfig.h"
32-
#include "shared-bindings/nvm/ByteArray.h"
28+
#include "mpconfigboard.h"
3329
#include "common-hal/microcontroller/Pin.h"
3430
#include "hal/include/hal_gpio.h"
3531
#include "shared-bindings/pwmio/PWMOut.h"
3632

37-
nvm_bytearray_obj_t bootcnt = {
38-
.base = {
39-
.type = &nvm_bytearray_type
40-
},
41-
.len = (uint32_t)8192,
42-
.start_address = (uint8_t *)(0x00080000 - 8192)
43-
};
44-
45-
4633
void board_init(void) {
4734
pwmio_pwmout_obj_t pwm;
4835
common_hal_pwmio_pwmout_construct(&pwm, &pin_PA23, 4096, 2, false);
@@ -54,8 +41,7 @@ bool board_requests_safe_mode(void) {
5441
}
5542

5643
void reset_board(void) {
57-
uint8_t value_out = 0;
58-
common_hal_nvm_bytearray_get_bytes(&bootcnt,0,1,&value_out);
59-
++value_out;
60-
common_hal_nvm_bytearray_set_bytes(&bootcnt,0,&value_out,1);
44+
}
45+
46+
void board_deinit(void) {
6147
}

ports/atmel-samd/boards/pycubed/mpconfigboard.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
// External flash W25Q80DV
1616
#define EXTERNAL_FLASH_QSPI_DUAL
1717

18+
#define CIRCUITPY_DRIVE_LABEL "PYCUBED"
19+
#define CIRCUITPY_BOOT_COUNTER 1
20+
1821
#define BOARD_HAS_CRYSTAL 1
1922

2023
#define DEFAULT_I2C_BUS_SCL (&pin_PB13)

ports/atmel-samd/boards/pycubed/mpconfigboard.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ QSPI_FLASH_FILESYSTEM = 1
1010
EXTERNAL_FLASH_DEVICES = W25Q80DV
1111
LONGINT_IMPL = MPZ
1212

13-
CIRCUITPY_DRIVE_LABEL = "PYCUBED"
14-
1513
CIRCUITPY_ULAB = 1
1614
CIRCUITPY_BINASCII = 1
1715
CIRCUITPY_SDCARDIO = 1

ports/atmel-samd/boards/pycubed_mram/board.c

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

27-
28-
#include <string.h>
29-
3027
#include "supervisor/board.h"
31-
#include "py/mpconfig.h"
32-
#include "shared-bindings/nvm/ByteArray.h"
28+
#include "mpconfigboard.h"
3329
#include "common-hal/microcontroller/Pin.h"
3430
#include "hal/include/hal_gpio.h"
3531
#include "shared-bindings/pwmio/PWMOut.h"
3632

37-
nvm_bytearray_obj_t bootcnt = {
38-
.base = {
39-
.type = &nvm_bytearray_type
40-
},
41-
.len = (uint32_t)8192,
42-
.start_address = (uint8_t *)(0x00080000 - 8192)
43-
};
44-
45-
4633
void board_init(void) {
4734
pwmio_pwmout_obj_t pwm;
4835
common_hal_pwmio_pwmout_construct(&pwm, &pin_PA23, 4096, 2, false);
@@ -54,8 +41,7 @@ bool board_requests_safe_mode(void) {
5441
}
5542

5643
void reset_board(void) {
57-
uint8_t value_out = 0;
58-
common_hal_nvm_bytearray_get_bytes(&bootcnt,0,1,&value_out);
59-
++value_out;
60-
common_hal_nvm_bytearray_set_bytes(&bootcnt,0,&value_out,1);
44+
}
45+
46+
void board_deinit(void) {
6147
}

ports/atmel-samd/boards/pycubed_mram/mpconfigboard.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515

1616
#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE)
1717

18+
#define CIRCUITPY_DRIVE_LABEL "PYCUBED"
19+
#define CIRCUITPY_BOOT_COUNTER 1
20+
1821
#define BOARD_HAS_CRYSTAL 1
1922

2023
#define DEFAULT_I2C_BUS_SCL (&pin_PB13)

ports/atmel-samd/boards/pycubed_mram/mpconfigboard.mk

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,25 @@ QSPI_FLASH_FILESYSTEM = 1
1010
EXTERNAL_FLASH_DEVICES = MR2xH40
1111
LONGINT_IMPL = MPZ
1212

13-
CIRCUITPY_DRIVE_LABEL = "PYCUBED"
13+
CIRCUITPY_ULAB = 1
14+
CIRCUITPY_BINASCII = 1
15+
CIRCUITPY_SDCARDIO = 1
16+
CIRCUITPY_JSON = 1
17+
CIRCUITPY_MSGPACK = 1
18+
CIRCUITPY_ALARM = 1
1419

15-
# Not needed.
20+
# no SAMD51 support... yet ;)
21+
# CIRCUITPY_DUALBANK=1
22+
23+
# Not needed
1624
CIRCUITPY_AUDIOBUSIO = 0
17-
CIRCUITPY_BITMAPTOOLS = 0
1825
CIRCUITPY_DISPLAYIO = 0
1926
CIRCUITPY_FRAMEBUFFERIO = 0
2027
CIRCUITPY_KEYPAD = 0
2128
CIRCUITPY_RGBMATRIX = 0
2229
CIRCUITPY_PS2IO = 0
30+
CIRCUITPY_BLEIO_HCI=0
31+
CIRCUITPY_BLEIO=0
2332

2433
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
2534
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Register
26-
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SD

ports/atmel-samd/boards/pycubed_mram_v05/board.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,6 @@ bool board_requests_safe_mode(void) {
4242

4343
void reset_board(void) {
4444
}
45+
46+
void board_deinit(void) {
47+
}

ports/atmel-samd/boards/pycubed_mram_v05/mpconfigboard.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ CIRCUITPY_BINASCII = 1
1515
CIRCUITPY_SDCARDIO = 1
1616
CIRCUITPY_JSON = 1
1717
CIRCUITPY_MSGPACK = 1
18+
CIRCUITPY_ALARM = 1
1819

1920
# no SAMD51 support... yet ;)
20-
# CIRCUITPY_ALARM = 1
2121
# CIRCUITPY_DUALBANK=1
2222

2323
# Not needed

ports/atmel-samd/boards/pycubed_v05/board.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,6 @@ bool board_requests_safe_mode(void) {
4242

4343
void reset_board(void) {
4444
}
45+
46+
void board_deinit(void) {
47+
}

ports/atmel-samd/boards/pycubed_v05/mpconfigboard.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ EXTERNAL_FLASH_DEVICE_COUNT = 1
1111
EXTERNAL_FLASH_DEVICES = W25Q80DV
1212
LONGINT_IMPL = MPZ
1313

14-
CIRCUITPY_DRIVE_LABEL = "PYCUBED"
15-
1614
CIRCUITPY_ULAB = 1
1715
CIRCUITPY_BINASCII = 1
1816
CIRCUITPY_SDCARDIO = 1

0 commit comments

Comments
 (0)