summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHierophect <hierophect@gmail.com>2019-07-22 12:58:28 -0400
committerHierophect <hierophect@gmail.com>2019-07-22 12:58:28 -0400
commit58630a844ad1db7d30671a3cb18f433e015a40a3 (patch)
tree4e481c7c9fd007faaa98f879724a89610cf870b7
parent10b9ca5a92d876e6a3f0e6fb2fb0c2b317c5046a (diff)
Add feature conditionals and clean up
-rwxr-xr-xmain.c13
-rw-r--r--ports/nrf/common-hal/microcontroller/Pin.c2
-rw-r--r--ports/stm32f4/boards/DIS_F411RE/board.c (renamed from ports/stm32f4/boards/stm32f411_disco/board.c)0
-rw-r--r--ports/stm32f4/boards/DIS_F411RE/mpconfigboard.h (renamed from ports/stm32f4/boards/stm32f411_disco/mpconfigboard.h)0
-rw-r--r--ports/stm32f4/boards/DIS_F411RE/mpconfigboard.mk (renamed from ports/stm32f4/boards/stm32f411_disco/mpconfigboard.mk)0
-rw-r--r--ports/stm32f4/boards/DIS_F411RE/pins.c (renamed from ports/stm32f4/boards/stm32f411_disco/pins.c)0
-rw-r--r--ports/stm32f4/boards/DIS_F411RE/stm32f4xx_hal_conf.h (renamed from ports/stm32f4/boards/stm32f411_disco/stm32f4xx_hal_conf.h)0
-rw-r--r--ports/stm32f4/boards/DIS_F411RE/stm32f4xx_hal_msp.c (renamed from ports/stm32f4/boards/stm32f411_disco/stm32f4xx_hal_msp.c)0
-rw-r--r--ports/stm32f4/boards/DIS_F411RE/stm32f4xx_it.c (renamed from ports/stm32f4/boards/stm32f411_disco/stm32f4xx_it.c)0
-rw-r--r--ports/stm32f4/boards/DIS_F411RE/stm32f4xx_it.h (renamed from ports/stm32f4/boards/stm32f411_disco/stm32f4xx_it.h)0
-rw-r--r--ports/stm32f4/boards/DIS_F412ZG/board.c (renamed from ports/stm32f4/boards/stm32f412g_disco/board.c)0
-rw-r--r--ports/stm32f4/boards/DIS_F412ZG/mpconfigboard.h (renamed from ports/stm32f4/boards/stm32f412g_disco/mpconfigboard.h)0
-rw-r--r--ports/stm32f4/boards/DIS_F412ZG/mpconfigboard.mk (renamed from ports/stm32f4/boards/stm32f412g_disco/mpconfigboard.mk)0
-rw-r--r--ports/stm32f4/boards/DIS_F412ZG/pins.c (renamed from ports/stm32f4/boards/stm32f412g_disco/pins.c)0
-rw-r--r--ports/stm32f4/boards/DIS_F412ZG/stm32f4xx_hal_conf.h (renamed from ports/stm32f4/boards/stm32f412g_disco/stm32f4xx_hal_conf.h)0
-rw-r--r--ports/stm32f4/boards/DIS_F412ZG/stm32f4xx_hal_msp.c (renamed from ports/stm32f4/boards/stm32f412g_disco/stm32f4xx_hal_msp.c)0
-rw-r--r--ports/stm32f4/boards/DIS_F412ZG/stm32f4xx_it.c (renamed from ports/stm32f4/boards/stm32f412g_disco/stm32f4xx_it.c)0
-rw-r--r--ports/stm32f4/boards/DIS_F412ZG/stm32f4xx_it.h (renamed from ports/stm32f4/boards/stm32f412g_disco/stm32f4xx_it.h)0
-rw-r--r--ports/stm32f4/common-hal/busio/I2C.h2
-rw-r--r--ports/stm32f4/common-hal/busio/SPI.h1
-rw-r--r--ports/stm32f4/common-hal/busio/UART.h1
-rw-r--r--ports/stm32f4/common-hal/digitalio/DigitalInOut.h2
-rw-r--r--ports/stm32f4/supervisor/internal_flash.c7
-rw-r--r--shared-bindings/board/__init__.c104
-rw-r--r--shared-module/board/__init__.c16
-rw-r--r--shared-module/usb_hid/Device.c1
-rwxr-xr-xsupervisor/shared/memory.c2
-rw-r--r--supervisor/shared/micropython.c6
-rw-r--r--supervisor/shared/safe_mode.c20
-rw-r--r--supervisor/shared/status_leds.c2
-rw-r--r--supervisor/shared/usb/usb.c6
-rw-r--r--supervisor/supervisor.mk13
32 files changed, 95 insertions, 103 deletions
diff --git a/main.c b/main.c
index 10c94ad52..1fea43ce3 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 49b3c15ca..3cee784b6 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
index 4421970ee..4421970ee 100644
--- a/ports/stm32f4/boards/stm32f411_disco/board.c
+++ b/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
index 675443282..675443282 100644
--- a/ports/stm32f4/boards/stm32f411_disco/mpconfigboard.h
+++ b/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
index 523628504..523628504 100644
--- a/ports/stm32f4/boards/stm32f411_disco/mpconfigboard.mk
+++ b/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
index e3a4b5ed6..e3a4b5ed6 100644
--- a/ports/stm32f4/boards/stm32f411_disco/pins.c
+++ b/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
index 4b6ba3d03..4b6ba3d03 100644
--- a/ports/stm32f4/boards/stm32f411_disco/stm32f4xx_hal_conf.h
+++ b/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
index 4989f9889..4989f9889 100644
--- a/ports/stm32f4/boards/stm32f411_disco/stm32f4xx_hal_msp.c
+++ b/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
index cb86910e2..cb86910e2 100644
--- a/ports/stm32f4/boards/stm32f411_disco/stm32f4xx_it.c
+++ b/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
index feee38a39..feee38a39 100644
--- a/ports/stm32f4/boards/stm32f411_disco/stm32f4xx_it.h
+++ b/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
index 4421970ee..4421970ee 100644
--- a/ports/stm32f4/boards/stm32f412g_disco/board.c
+++ b/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
index 416944257..416944257 100644
--- a/ports/stm32f4/boards/stm32f412g_disco/mpconfigboard.h
+++ b/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
index 9e8711c36..9e8711c36 100644
--- a/ports/stm32f4/boards/stm32f412g_disco/mpconfigboard.mk
+++ b/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
index e3a4b5ed6..e3a4b5ed6 100644
--- a/ports/stm32f4/boards/stm32f412g_disco/pins.c
+++ b/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
index 5d329c14f..5d329c14f 100644
--- a/ports/stm32f4/boards/stm32f412g_disco/stm32f4xx_hal_conf.h
+++ b/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
index 9d29f3607..9d29f3607 100644
--- a/ports/stm32f4/boards/stm32f412g_disco/stm32f4xx_hal_msp.c
+++ b/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
index 032a55472..032a55472 100644
--- a/ports/stm32f4/boards/stm32f412g_disco/stm32f4xx_it.c
+++ b/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
index 4571df2e3..4571df2e3 100644
--- a/ports/stm32f4/boards/stm32f412g_disco/stm32f4xx_it.h
+++ b/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 b75d15f00..6f6711167 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 1b0de8acf..36fc0350c 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 58432001c..80a707f71 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 c6b3d21d2..9122ba4a1 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 da9825bec..fa776ae1d 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 ccf9ec5ab..9107fc57f 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 b29e9df61..5a1dead78 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 a2a4c30ac..0e256cb5e 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 c9c4bc2d5..11133415d 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 db9864793..245db11d4 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 33a9e660e..97b2d8d42 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 d99853ceb..672242a96 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 b3c16f4ae..0678a3a3f 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 4ea3a8260..b4d7e9d50 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/safe_mode.c \
supervisor/shared/stack.c \
+ supervisor/shared/status_leds.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/translate.c \
+
ifndef $(NO_USB)
NO_USB = $(wildcard supervisor/usb.c)
endif