diff options
| author | Kevin Townsend <contact@microbuilder.eu> | 2017-11-23 09:22:11 +0100 |
|---|---|---|
| committer | Kevin Townsend <contact@microbuilder.eu> | 2017-11-23 09:22:11 +0100 |
| commit | 92113dde815ce5aaecf63ea9e87bc4addcabd822 (patch) | |
| tree | d3813ad609755744b1223c0207e6d4a85f6864fc /ports/nrf/modules | |
| parent | a38d8948b3b22a7b3f84284f765578a8edeab3f5 (diff) | |
Supervisor REPL support for ports/nrf/boards/feather52
Diffstat (limited to 'ports/nrf/modules')
| -rw-r--r-- | ports/nrf/modules/machine/pin.h | 15 | ||||
| -rw-r--r-- | ports/nrf/modules/machine/uart.c | 10 |
2 files changed, 19 insertions, 6 deletions
diff --git a/ports/nrf/modules/machine/pin.h b/ports/nrf/modules/machine/pin.h index 1935a0d26..e9a8c031b 100644 --- a/ports/nrf/modules/machine/pin.h +++ b/ports/nrf/modules/machine/pin.h @@ -62,6 +62,9 @@ typedef struct { uint32_t pull; } pin_obj_t; +// Adafruit +extern const mp_obj_type_t mcu_pin_type; + extern const mp_obj_type_t pin_type; extern const mp_obj_type_t pin_af_type; @@ -84,8 +87,16 @@ typedef struct { extern const mp_obj_type_t pin_board_pins_obj_type; extern const mp_obj_type_t pin_cpu_pins_obj_type; -extern const mp_obj_dict_t pin_cpu_pins_locals_dict; -extern const mp_obj_dict_t pin_board_pins_locals_dict; +//extern const mp_obj_dict_t pin_cpu_pins_locals_dict; +//extern const mp_obj_dict_t pin_board_pins_locals_dict; + +// Adafruit modification for CircuitPython board module +extern const mp_obj_dict_t mcu_pin_globals; +extern const mp_obj_dict_t board_module_globals; + +#define pin_cpu_pins_locals_dict mcu_pin_globals +#define pin_board_pins_locals_dict board_module_globals + MP_DECLARE_CONST_FUN_OBJ_KW(pin_init_obj); diff --git a/ports/nrf/modules/machine/uart.c b/ports/nrf/modules/machine/uart.c index b99afef62..f03429964 100644 --- a/ports/nrf/modules/machine/uart.c +++ b/ports/nrf/modules/machine/uart.c @@ -65,6 +65,8 @@ void uart_init0(void) { // reset the UART handles memset(&UARTHandle0, 0, sizeof(UART_HandleTypeDef)); UARTHandle0.p_instance = UART_BASE(0); + UARTHandle0.init.irq_num = UARTE0_UART0_IRQn; + #if NRF52840_XXAA memset(&UARTHandle1, 0, sizeof(UART_HandleTypeDef)); UARTHandle0.p_instance = UART_BASE(1); @@ -82,13 +84,13 @@ STATIC int uart_find(mp_obj_t id) { "UART(%d) does not exist", uart_id)); } -void uart_irq_handler(mp_uint_t uart_id) { - -} +//void uart_irq_handler(mp_uint_t uart_id) { +// +//} bool uart_rx_any(machine_hard_uart_obj_t *uart_obj) { // TODO: uart will block for now. - return true; + return hal_uart_available(uart_obj->uart->p_instance) > 0; } int uart_rx_char(machine_hard_uart_obj_t * self) { |
