Skip to content

Commit 4a8643e

Browse files
committed
Moved GPIO ports to board.c to make it easy to add boards in the future. Added priority to remaining TODOs (low)
1 parent 58277a4 commit 4a8643e

4 files changed

Lines changed: 9 additions & 7 deletions

File tree

ports/analog/boards/apard32690/board.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
#include "max32_port.h"
1111

1212
// Board-level setup for MAX32690
13+
mxc_gpio_regs_t* gpio_ports[NUM_GPIO_PORTS] =
14+
{MXC_GPIO0, MXC_GPIO1, MXC_GPIO2, MXC_GPIO3, MXC_GPIO4};
15+
1316
// clang-format off
1417
const mxc_gpio_cfg_t pb_pin[] = {
1518
{ MXC_GPIO1, MXC_GPIO_PIN_27, MXC_GPIO_FUNC_IN, MXC_GPIO_PAD_NONE, MXC_GPIO_VSSEL_VDDIOH, MXC_GPIO_DRVSTR_0},

ports/analog/boards/max32690evkit/board.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
#include "max32_port.h"
1111

1212
// Board-level setup for MAX32690
13+
mxc_gpio_regs_t* gpio_ports[NUM_GPIO_PORTS] =
14+
{MXC_GPIO0, MXC_GPIO1, MXC_GPIO2, MXC_GPIO3, MXC_GPIO4};
15+
1316
// clang-format off
1417
const mxc_gpio_cfg_t pb_pin[] = {
1518
{ MXC_GPIO4, MXC_GPIO_PIN_0, MXC_GPIO_FUNC_IN, MXC_GPIO_PAD_NONE, MXC_GPIO_VSSEL_VDDIOH, MXC_GPIO_DRVSTR_0},

ports/analog/common-hal/microcontroller/Pin.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,8 @@
1616

1717
static uint32_t claimed_pins[NUM_GPIO_PORTS];
1818

19-
// todo (low): try moving this to an extern in the board support
20-
#ifdef MAX32690
21-
#include "max32690.h"
22-
mxc_gpio_regs_t* gpio_ports[NUM_GPIO_PORTS] =
23-
{MXC_GPIO0, MXC_GPIO1, MXC_GPIO2, MXC_GPIO3, MXC_GPIO4};
24-
#endif
19+
// defined in board.c
20+
extern mxc_gpio_regs_t* gpio_ports[NUM_GPIO_PORTS];
2521

2622
static uint32_t never_reset_pins[NUM_GPIO_PORTS];
2723

ports/analog/common-hal/os/__init__.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ mp_obj_t common_hal_os_uname(void) {
4343

4444
bool common_hal_os_urandom(uint8_t *buffer, uint32_t length) {
4545
#if (HAS_TRNG)
46-
//todo: implement
46+
//todo (low prior): implement
4747
#else
4848
#endif
4949
return false;

0 commit comments

Comments
 (0)