diff options
| author | Hierophect <hierophect@gmail.com> | 2019-07-22 12:58:28 -0400 |
|---|---|---|
| committer | Hierophect <hierophect@gmail.com> | 2019-07-22 12:58:28 -0400 |
| commit | 58630a844ad1db7d30671a3cb18f433e015a40a3 (patch) | |
| tree | 4e481c7c9fd007faaa98f879724a89610cf870b7 /supervisor/shared | |
| parent | 10b9ca5a92d876e6a3f0e6fb2fb0c2b317c5046a (diff) | |
Add feature conditionals and clean up
Diffstat (limited to 'supervisor/shared')
| -rwxr-xr-x | supervisor/shared/memory.c | 2 | ||||
| -rw-r--r-- | supervisor/shared/micropython.c | 6 | ||||
| -rw-r--r-- | supervisor/shared/safe_mode.c | 20 | ||||
| -rw-r--r-- | supervisor/shared/status_leds.c | 2 | ||||
| -rw-r--r-- | supervisor/shared/usb/usb.c | 6 |
5 files changed, 18 insertions, 18 deletions
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'}; |
