From 58630a844ad1db7d30671a3cb18f433e015a40a3 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Mon, 22 Jul 2019 12:58:28 -0400 Subject: [PATCH] Add feature conditionals and clean up --- main.c | 13 ++- ports/nrf/common-hal/microcontroller/Pin.c | 2 +- .../{stm32f411_disco => DIS_F411RE}/board.c | 0 .../mpconfigboard.h | 0 .../mpconfigboard.mk | 0 .../{stm32f411_disco => DIS_F411RE}/pins.c | 0 .../stm32f4xx_hal_conf.h | 0 .../stm32f4xx_hal_msp.c | 0 .../stm32f4xx_it.c | 0 .../stm32f4xx_it.h | 0 .../{stm32f412g_disco => DIS_F412ZG}/board.c | 0 .../mpconfigboard.h | 0 .../mpconfigboard.mk | 0 .../{stm32f412g_disco => DIS_F412ZG}/pins.c | 0 .../stm32f4xx_hal_conf.h | 0 .../stm32f4xx_hal_msp.c | 0 .../stm32f4xx_it.c | 0 .../stm32f4xx_it.h | 0 ports/stm32f4/common-hal/busio/I2C.h | 2 - ports/stm32f4/common-hal/busio/SPI.h | 1 - ports/stm32f4/common-hal/busio/UART.h | 1 - .../common-hal/digitalio/DigitalInOut.h | 2 +- ports/stm32f4/supervisor/internal_flash.c | 7 -- shared-bindings/board/__init__.c | 104 +++++++++--------- shared-module/board/__init__.c | 16 +-- shared-module/usb_hid/Device.c | 1 - supervisor/shared/memory.c | 2 +- supervisor/shared/micropython.c | 6 +- supervisor/shared/safe_mode.c | 20 ++-- supervisor/shared/status_leds.c | 2 + supervisor/shared/usb/usb.c | 6 +- supervisor/supervisor.mk | 15 +-- 32 files changed, 96 insertions(+), 104 deletions(-) rename ports/stm32f4/boards/{stm32f411_disco => DIS_F411RE}/board.c (100%) rename ports/stm32f4/boards/{stm32f411_disco => DIS_F411RE}/mpconfigboard.h (100%) rename ports/stm32f4/boards/{stm32f411_disco => DIS_F411RE}/mpconfigboard.mk (100%) rename ports/stm32f4/boards/{stm32f411_disco => DIS_F411RE}/pins.c (100%) rename ports/stm32f4/boards/{stm32f411_disco => DIS_F411RE}/stm32f4xx_hal_conf.h (100%) rename ports/stm32f4/boards/{stm32f411_disco => DIS_F411RE}/stm32f4xx_hal_msp.c (100%) rename ports/stm32f4/boards/{stm32f411_disco => DIS_F411RE}/stm32f4xx_it.c (100%) rename ports/stm32f4/boards/{stm32f411_disco => DIS_F411RE}/stm32f4xx_it.h (100%) rename ports/stm32f4/boards/{stm32f412g_disco => DIS_F412ZG}/board.c (100%) rename ports/stm32f4/boards/{stm32f412g_disco => DIS_F412ZG}/mpconfigboard.h (100%) rename ports/stm32f4/boards/{stm32f412g_disco => DIS_F412ZG}/mpconfigboard.mk (100%) rename ports/stm32f4/boards/{stm32f412g_disco => DIS_F412ZG}/pins.c (100%) rename ports/stm32f4/boards/{stm32f412g_disco => DIS_F412ZG}/stm32f4xx_hal_conf.h (100%) rename ports/stm32f4/boards/{stm32f412g_disco => DIS_F412ZG}/stm32f4xx_hal_msp.c (100%) rename ports/stm32f4/boards/{stm32f412g_disco => DIS_F412ZG}/stm32f4xx_it.c (100%) rename ports/stm32f4/boards/{stm32f412g_disco => DIS_F412ZG}/stm32f4xx_it.h (100%) diff --git a/main.c b/main.c index 10c94ad52b..1fea43ce33 100755 --- a/main.c +++ b/main.c @@ -45,7 +45,6 @@ #include "background.h" #include "mpconfigboard.h" -//#include "shared-module/displayio/__init__.h" #include "supervisor/cpu.h" #include "supervisor/memory.h" #include "supervisor/port.h" @@ -58,6 +57,10 @@ #include "supervisor/shared/stack.h" #include "supervisor/serial.h" +#if CIRCUITPY_DISPLAYIO +#include "shared-module/displayio/__init__.h" +#endif + #if CIRCUITPY_NETWORK #include "shared-module/network/__init__.h" #endif @@ -187,7 +190,7 @@ void cleanup_after_vm(supervisor_allocation* heap) { supervisor_move_memory(); reset_port(); - //reset_board_busses(); + reset_board_busses(); reset_board(); reset_status_led(); } @@ -392,8 +395,10 @@ int __attribute__((used)) main(void) { safe_mode_t safe_mode = port_init(); // Turn on LEDs - //init_status_leds(); - //rgb_led_status_init(); + #if MICROPY_HW_LED_RX && MICROPY_HW_LED_RX + init_status_leds(); + rgb_led_status_init(); + #endif // Wait briefly to give a reset window where we'll enter safe mode after the reset. if (safe_mode == NO_SAFE_MODE) { diff --git a/ports/nrf/common-hal/microcontroller/Pin.c b/ports/nrf/common-hal/microcontroller/Pin.c index 49b3c15ca0..3cee784b63 100644 --- a/ports/nrf/common-hal/microcontroller/Pin.c +++ b/ports/nrf/common-hal/microcontroller/Pin.c @@ -105,7 +105,7 @@ void reset_pin_number(uint8_t pin_number) { #ifdef SPEAKER_ENABLE_PIN if (pin_number == SPEAKER_ENABLE_PIN->number) { speaker_enable_in_use = false; - common_hal_digitalio_digitalinout_switch_to_output(); + common_hal_digitalio_digitalinout_switch_to_output(SPEAKER_ENABLE_PIN, true, DRIVE_MODE_PUSH_PULL); nrf_gpio_pin_dir_set(pin_number, NRF_GPIO_PIN_DIR_OUTPUT); nrf_gpio_pin_write(pin_number, false); } diff --git a/ports/stm32f4/boards/stm32f411_disco/board.c b/ports/stm32f4/boards/DIS_F411RE/board.c similarity index 100% rename from ports/stm32f4/boards/stm32f411_disco/board.c rename to ports/stm32f4/boards/DIS_F411RE/board.c diff --git a/ports/stm32f4/boards/stm32f411_disco/mpconfigboard.h b/ports/stm32f4/boards/DIS_F411RE/mpconfigboard.h similarity index 100% rename from ports/stm32f4/boards/stm32f411_disco/mpconfigboard.h rename to ports/stm32f4/boards/DIS_F411RE/mpconfigboard.h diff --git a/ports/stm32f4/boards/stm32f411_disco/mpconfigboard.mk b/ports/stm32f4/boards/DIS_F411RE/mpconfigboard.mk similarity index 100% rename from ports/stm32f4/boards/stm32f411_disco/mpconfigboard.mk rename to ports/stm32f4/boards/DIS_F411RE/mpconfigboard.mk diff --git a/ports/stm32f4/boards/stm32f411_disco/pins.c b/ports/stm32f4/boards/DIS_F411RE/pins.c similarity index 100% rename from ports/stm32f4/boards/stm32f411_disco/pins.c rename to ports/stm32f4/boards/DIS_F411RE/pins.c diff --git a/ports/stm32f4/boards/stm32f411_disco/stm32f4xx_hal_conf.h b/ports/stm32f4/boards/DIS_F411RE/stm32f4xx_hal_conf.h similarity index 100% rename from ports/stm32f4/boards/stm32f411_disco/stm32f4xx_hal_conf.h rename to ports/stm32f4/boards/DIS_F411RE/stm32f4xx_hal_conf.h diff --git a/ports/stm32f4/boards/stm32f411_disco/stm32f4xx_hal_msp.c b/ports/stm32f4/boards/DIS_F411RE/stm32f4xx_hal_msp.c similarity index 100% rename from ports/stm32f4/boards/stm32f411_disco/stm32f4xx_hal_msp.c rename to ports/stm32f4/boards/DIS_F411RE/stm32f4xx_hal_msp.c diff --git a/ports/stm32f4/boards/stm32f411_disco/stm32f4xx_it.c b/ports/stm32f4/boards/DIS_F411RE/stm32f4xx_it.c similarity index 100% rename from ports/stm32f4/boards/stm32f411_disco/stm32f4xx_it.c rename to ports/stm32f4/boards/DIS_F411RE/stm32f4xx_it.c diff --git a/ports/stm32f4/boards/stm32f411_disco/stm32f4xx_it.h b/ports/stm32f4/boards/DIS_F411RE/stm32f4xx_it.h similarity index 100% rename from ports/stm32f4/boards/stm32f411_disco/stm32f4xx_it.h rename to ports/stm32f4/boards/DIS_F411RE/stm32f4xx_it.h diff --git a/ports/stm32f4/boards/stm32f412g_disco/board.c b/ports/stm32f4/boards/DIS_F412ZG/board.c similarity index 100% rename from ports/stm32f4/boards/stm32f412g_disco/board.c rename to ports/stm32f4/boards/DIS_F412ZG/board.c diff --git a/ports/stm32f4/boards/stm32f412g_disco/mpconfigboard.h b/ports/stm32f4/boards/DIS_F412ZG/mpconfigboard.h similarity index 100% rename from ports/stm32f4/boards/stm32f412g_disco/mpconfigboard.h rename to ports/stm32f4/boards/DIS_F412ZG/mpconfigboard.h diff --git a/ports/stm32f4/boards/stm32f412g_disco/mpconfigboard.mk b/ports/stm32f4/boards/DIS_F412ZG/mpconfigboard.mk similarity index 100% rename from ports/stm32f4/boards/stm32f412g_disco/mpconfigboard.mk rename to ports/stm32f4/boards/DIS_F412ZG/mpconfigboard.mk diff --git a/ports/stm32f4/boards/stm32f412g_disco/pins.c b/ports/stm32f4/boards/DIS_F412ZG/pins.c similarity index 100% rename from ports/stm32f4/boards/stm32f412g_disco/pins.c rename to ports/stm32f4/boards/DIS_F412ZG/pins.c diff --git a/ports/stm32f4/boards/stm32f412g_disco/stm32f4xx_hal_conf.h b/ports/stm32f4/boards/DIS_F412ZG/stm32f4xx_hal_conf.h similarity index 100% rename from ports/stm32f4/boards/stm32f412g_disco/stm32f4xx_hal_conf.h rename to ports/stm32f4/boards/DIS_F412ZG/stm32f4xx_hal_conf.h diff --git a/ports/stm32f4/boards/stm32f412g_disco/stm32f4xx_hal_msp.c b/ports/stm32f4/boards/DIS_F412ZG/stm32f4xx_hal_msp.c similarity index 100% rename from ports/stm32f4/boards/stm32f412g_disco/stm32f4xx_hal_msp.c rename to ports/stm32f4/boards/DIS_F412ZG/stm32f4xx_hal_msp.c diff --git a/ports/stm32f4/boards/stm32f412g_disco/stm32f4xx_it.c b/ports/stm32f4/boards/DIS_F412ZG/stm32f4xx_it.c similarity index 100% rename from ports/stm32f4/boards/stm32f412g_disco/stm32f4xx_it.c rename to ports/stm32f4/boards/DIS_F412ZG/stm32f4xx_it.c diff --git a/ports/stm32f4/boards/stm32f412g_disco/stm32f4xx_it.h b/ports/stm32f4/boards/DIS_F412ZG/stm32f4xx_it.h similarity index 100% rename from ports/stm32f4/boards/stm32f412g_disco/stm32f4xx_it.h rename to ports/stm32f4/boards/DIS_F412ZG/stm32f4xx_it.h diff --git a/ports/stm32f4/common-hal/busio/I2C.h b/ports/stm32f4/common-hal/busio/I2C.h index b75d15f00f..6f6711167f 100644 --- a/ports/stm32f4/common-hal/busio/I2C.h +++ b/ports/stm32f4/common-hal/busio/I2C.h @@ -27,8 +27,6 @@ #ifndef MICROPY_INCLUDED_NRF_COMMON_HAL_BUSIO_I2C_H #define MICROPY_INCLUDED_NRF_COMMON_HAL_BUSIO_I2C_H -#include "nrfx_twim.h" - #include "py/obj.h" typedef struct { diff --git a/ports/stm32f4/common-hal/busio/SPI.h b/ports/stm32f4/common-hal/busio/SPI.h index 1b0de8acfd..36fc0350cc 100644 --- a/ports/stm32f4/common-hal/busio/SPI.h +++ b/ports/stm32f4/common-hal/busio/SPI.h @@ -27,7 +27,6 @@ #ifndef MICROPY_INCLUDED_NRF_COMMON_HAL_BUSIO_SPI_H #define MICROPY_INCLUDED_NRF_COMMON_HAL_BUSIO_SPI_H -#include "nrfx_spim.h" #include "py/obj.h" typedef struct { diff --git a/ports/stm32f4/common-hal/busio/UART.h b/ports/stm32f4/common-hal/busio/UART.h index 58432001cd..80a707f71a 100644 --- a/ports/stm32f4/common-hal/busio/UART.h +++ b/ports/stm32f4/common-hal/busio/UART.h @@ -28,7 +28,6 @@ #define MICROPY_INCLUDED_NRF_COMMON_HAL_BUSIO_UART_H #include "common-hal/microcontroller/Pin.h" -#include "nrfx_uarte.h" #include "py/obj.h" #include "py/ringbuf.h" diff --git a/ports/stm32f4/common-hal/digitalio/DigitalInOut.h b/ports/stm32f4/common-hal/digitalio/DigitalInOut.h index c6b3d21d26..9122ba4a13 100644 --- a/ports/stm32f4/common-hal/digitalio/DigitalInOut.h +++ b/ports/stm32f4/common-hal/digitalio/DigitalInOut.h @@ -27,7 +27,7 @@ #ifndef MICROPY_INCLUDED_NRF_COMMON_HAL_DIGITALIO_DIGITALINOUT_H #define MICROPY_INCLUDED_NRF_COMMON_HAL_DIGITALIO_DIGITALINOUT_H -//#include "common-hal/microcontroller/Pin.h" +#include "common-hal/microcontroller/Pin.h" typedef struct { mp_obj_base_t base; diff --git a/ports/stm32f4/supervisor/internal_flash.c b/ports/stm32f4/supervisor/internal_flash.c index da9825bec8..fa776ae1de 100644 --- a/ports/stm32f4/supervisor/internal_flash.c +++ b/ports/stm32f4/supervisor/internal_flash.c @@ -35,13 +35,6 @@ #include "py/runtime.h" #include "lib/oofatfs/ff.h" -// #include "peripherals/nrf/nvm.h" - -// #ifdef BLUETOOTH_SD -// #include "ble_drv.h" -// #include "nrf_sdm.h" -// #endif - /*------------------------------------------------------------------*/ /* Internal Flash API diff --git a/shared-bindings/board/__init__.c b/shared-bindings/board/__init__.c index ccf9ec5abf..9107fc57fb 100644 --- a/shared-bindings/board/__init__.c +++ b/shared-bindings/board/__init__.c @@ -46,23 +46,23 @@ //| Returns the `busio.I2C` object for the board designated SDA and SCL pins. It is a singleton. //| -// #if BOARD_I2C -// mp_obj_t board_i2c(void) { -// mp_obj_t singleton = common_hal_board_get_i2c(); -// if (singleton != NULL) { -// return singleton; -// } -// assert_pin_free(DEFAULT_I2C_BUS_SDA); -// assert_pin_free(DEFAULT_I2C_BUS_SCL); -// return common_hal_board_create_i2c(); -// } -// #else -// mp_obj_t board_i2c(void) { -// mp_raise_NotImplementedError_varg(translate("No default %q bus"), MP_QSTR_I2C); -// return NULL; -// } -// #endif -// MP_DEFINE_CONST_FUN_OBJ_0(board_i2c_obj, board_i2c); +#if BOARD_I2C +mp_obj_t board_i2c(void) { + mp_obj_t singleton = common_hal_board_get_i2c(); + if (singleton != NULL) { + return singleton; + } + assert_pin_free(DEFAULT_I2C_BUS_SDA); + assert_pin_free(DEFAULT_I2C_BUS_SCL); + return common_hal_board_create_i2c(); +} +#else +mp_obj_t board_i2c(void) { + mp_raise_NotImplementedError_varg(translate("No default %q bus"), MP_QSTR_I2C); + return NULL; +} +#endif +MP_DEFINE_CONST_FUN_OBJ_0(board_i2c_obj, board_i2c); // //| .. function:: SPI() @@ -70,48 +70,48 @@ // //| Returns the `busio.SPI` object for the board designated SCK, MOSI and MISO pins. It is a // //| singleton. // //| -// #if BOARD_SPI -// mp_obj_t board_spi(void) { -// mp_obj_t singleton = common_hal_board_get_spi(); -// if (singleton != NULL) { -// return singleton; -// } -// assert_pin_free(DEFAULT_SPI_BUS_SCK); -// assert_pin_free(DEFAULT_SPI_BUS_MOSI); -// assert_pin_free(DEFAULT_SPI_BUS_MISO); -// return common_hal_board_create_spi(); -// } -// #else -// mp_obj_t board_spi(void) { -// mp_raise_NotImplementedError_varg(translate("No default %q bus"), MP_QSTR_SPI); -// return NULL; -// } -// #endif -// MP_DEFINE_CONST_FUN_OBJ_0(board_spi_obj, board_spi); +#if BOARD_SPI +mp_obj_t board_spi(void) { + mp_obj_t singleton = common_hal_board_get_spi(); + if (singleton != NULL) { + return singleton; + } + assert_pin_free(DEFAULT_SPI_BUS_SCK); + assert_pin_free(DEFAULT_SPI_BUS_MOSI); + assert_pin_free(DEFAULT_SPI_BUS_MISO); + return common_hal_board_create_spi(); +} +#else +mp_obj_t board_spi(void) { + mp_raise_NotImplementedError_varg(translate("No default %q bus"), MP_QSTR_SPI); + return NULL; +} +#endif +MP_DEFINE_CONST_FUN_OBJ_0(board_spi_obj, board_spi); // //| .. function:: UART() // //| // //| Returns the `busio.UART` object for the board designated TX and RX pins. It is a singleton. // //| -// #if BOARD_UART -// mp_obj_t board_uart(void) { -// mp_obj_t singleton = common_hal_board_get_uart(); -// if (singleton != NULL) { -// return singleton; -// } +#if BOARD_UART +mp_obj_t board_uart(void) { + mp_obj_t singleton = common_hal_board_get_uart(); + if (singleton != NULL) { + return singleton; + } -// assert_pin_free(DEFAULT_UART_BUS_RX); -// assert_pin_free(DEFAULT_UART_BUS_TX); + assert_pin_free(DEFAULT_UART_BUS_RX); + assert_pin_free(DEFAULT_UART_BUS_TX); -// return common_hal_board_create_uart(); -// } -// #else -// mp_obj_t board_uart(void) { -// mp_raise_NotImplementedError_varg(translate("No default %q bus"), MP_QSTR_SPI); -// return NULL; -// } -// #endif -// MP_DEFINE_CONST_FUN_OBJ_0(board_uart_obj, board_uart); + return common_hal_board_create_uart(); +} +#else +mp_obj_t board_uart(void) { + mp_raise_NotImplementedError_varg(translate("No default %q bus"), MP_QSTR_SPI); + return NULL; +} +#endif +MP_DEFINE_CONST_FUN_OBJ_0(board_uart_obj, board_uart); const mp_obj_module_t board_module = { .base = { &mp_type_module }, diff --git a/shared-module/board/__init__.c b/shared-module/board/__init__.c index b29e9df618..5a1dead784 100644 --- a/shared-module/board/__init__.c +++ b/shared-module/board/__init__.c @@ -24,18 +24,20 @@ * THE SOFTWARE. */ -// #include "shared-bindings/busio/I2C.h" -// #include "shared-bindings/busio/SPI.h" -// #include "shared-bindings/busio/UART.h" - #include "shared-bindings/microcontroller/Pin.h" #include "supervisor/shared/translate.h" #include "mpconfigboard.h" #include "py/runtime.h" -// #ifdef CIRCUITPY_DISPLAYIO -// #include "shared-module/displayio/__init__.h" -// #endif +#if CIRCUITPY_BUSIO +#include "shared-bindings/busio/I2C.h" +#include "shared-bindings/busio/SPI.h" +#include "shared-bindings/busio/UART.h" +#endif + +#if CIRCUITPY_DISPLAYIO +#include "shared-module/displayio/__init__.h" +#endif #if BOARD_I2C mp_obj_t common_hal_board_get_i2c(void) { diff --git a/shared-module/usb_hid/Device.c b/shared-module/usb_hid/Device.c index a2a4c30ac6..0e256cb5e4 100644 --- a/shared-module/usb_hid/Device.c +++ b/shared-module/usb_hid/Device.c @@ -47,7 +47,6 @@ void common_hal_usb_hid_device_send_report(usb_hid_device_obj_t *self, uint8_t* // Wait until interface is ready, timeout = 2 seconds uint64_t end_ticks = ticks_ms + 2000; - while ( (ticks_ms < end_ticks) && !tud_hid_generic_ready() ) { } if ( !tud_hid_generic_ready() ) { diff --git a/supervisor/shared/memory.c b/supervisor/shared/memory.c index c9c4bc2d56..11133415d1 100755 --- a/supervisor/shared/memory.c +++ b/supervisor/shared/memory.c @@ -118,5 +118,5 @@ supervisor_allocation* allocate_memory(uint32_t length, bool high) { } void supervisor_move_memory(void) { - //supervisor_display_move_memory(); + supervisor_display_move_memory(); } diff --git a/supervisor/shared/micropython.c b/supervisor/shared/micropython.c index db98647937..245db11d42 100644 --- a/supervisor/shared/micropython.c +++ b/supervisor/shared/micropython.c @@ -30,7 +30,7 @@ #include "lib/oofatfs/ff.h" #include "py/mpconfig.h" -//#include "supervisor/shared/status_leds.h" +#include "supervisor/shared/status_leds.h" int mp_hal_stdin_rx_chr(void) { for (;;) { @@ -38,14 +38,14 @@ int mp_hal_stdin_rx_chr(void) { MICROPY_VM_HOOK_LOOP #endif if (serial_bytes_available()) { - //toggle_rx_led(); + toggle_rx_led(); return serial_read(); } } } void mp_hal_stdout_tx_strn(const char *str, size_t len) { - //toggle_tx_led(); + toggle_tx_led(); #ifdef CIRCUITPY_BOOT_OUTPUT_FILE if (boot_output_file != NULL) { diff --git a/supervisor/shared/safe_mode.c b/supervisor/shared/safe_mode.c index 33a9e660ed..97b2d8d42c 100644 --- a/supervisor/shared/safe_mode.c +++ b/supervisor/shared/safe_mode.c @@ -59,16 +59,16 @@ safe_mode_t wait_for_safe_mode_reset(void) { common_hal_digitalio_digitalinout_construct(&status_led, MICROPY_HW_LED_STATUS); common_hal_digitalio_digitalinout_switch_to_output(&status_led, true, DRIVE_MODE_PUSH_PULL); #endif - // uint64_t start_ticks = 0;//ticks_ms; - // uint64_t diff = 0; - // while (diff < 700) { - // #ifdef MICROPY_HW_LED_STATUS - // // Blink on for 100, off for 100, on for 100, off for 100 and on for 200 - // common_hal_digitalio_digitalinout_set_value(&status_led, diff > 100 && diff / 100 != 2 && diff / 100 != 4); - // #endif - // diff = 0 - start_ticks; - // //diff = ticks_ms - start_ticks; - // } + uint64_t start_ticks = ticks_ms; + uint64_t diff = 0; + while (diff < 700) { + #ifdef MICROPY_HW_LED_STATUS + // Blink on for 100, off for 100, on for 100, off for 100 and on for 200 + common_hal_digitalio_digitalinout_set_value(&status_led, diff > 100 && diff / 100 != 2 && diff / 100 != 4); + #endif + diff = 0 - start_ticks; + //diff = ticks_ms - start_ticks; + } #ifdef MICROPY_HW_LED_STATUS common_hal_digitalio_digitalinout_deinit(&status_led); #endif diff --git a/supervisor/shared/status_leds.c b/supervisor/shared/status_leds.c index d99853cebe..672242a963 100644 --- a/supervisor/shared/status_leds.c +++ b/supervisor/shared/status_leds.c @@ -26,8 +26,10 @@ #include "supervisor/shared/status_leds.h" +#if CIRCUITPY_DIGITALIO #include "common-hal/digitalio/DigitalInOut.h" #include "shared-bindings/digitalio/DigitalInOut.h" +#endif #ifdef MICROPY_HW_LED_RX digitalio_digitalinout_obj_t rx_led; diff --git a/supervisor/shared/usb/usb.c b/supervisor/shared/usb/usb.c index b3c16f4ae0..0678a3a3fc 100644 --- a/supervisor/shared/usb/usb.c +++ b/supervisor/shared/usb/usb.c @@ -40,10 +40,8 @@ extern uint16_t usb_serial_number[1 + COMMON_HAL_MCU_PROCESSOR_UID_LENGTH * 2]; void load_serial_number(void) { // create serial number based on device unique id - -//LUCIAN: edited to fake a serial number - uint8_t raw_id[COMMON_HAL_MCU_PROCESSOR_UID_LENGTH] = {'0','1','2','3'}; - //common_hal_mcu_processor_get_uid(raw_id); + uint8_t raw_id[COMMON_HAL_MCU_PROCESSOR_UID_LENGTH]; + common_hal_mcu_processor_get_uid(raw_id); static const char nibble_to_hex[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index 4ea3a82600..b4d7e9d50c 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -2,20 +2,17 @@ SRC_SUPERVISOR = \ main.c \ supervisor/port.c \ supervisor/shared/autoreload.c \ + supervisor/shared/display.c \ supervisor/shared/filesystem.c \ supervisor/shared/flash.c \ supervisor/shared/micropython.c \ supervisor/shared/rgb_led_status.c \ - supervisor/shared/stack.c \ supervisor/shared/safe_mode.c \ - supervisor/shared/translate.c - -#bug, not conditional -# supervisor/shared/display.c \ -# supervisor/shared/status_leds.c \ -# supervisor/shared/safe_mode.c \ - - + supervisor/shared/stack.c \ + supervisor/shared/status_leds.c \ + supervisor/shared/safe_mode.c \ + supervisor/shared/translate.c \ + ifndef $(NO_USB) NO_USB = $(wildcard supervisor/usb.c) endif