diff options
| author | Hierophect <hierophect@gmail.com> | 2019-07-01 19:47:10 -0400 |
|---|---|---|
| committer | Hierophect <hierophect@gmail.com> | 2019-07-01 19:47:10 -0400 |
| commit | 040acc3a3228c4204d8154656a1249171b68c75a (patch) | |
| tree | 3779fce6327c7396d1d2e02ca1426bc64dffbc31 | |
| parent | 94a2eff05c410ee6a111efa0c48abd78b3518092 (diff) | |
remove dependencies for stable build
| -rwxr-xr-x | ports/stm32f4/Makefile | 28 | ||||
| -rw-r--r-- | ports/stm32f4/startup_stm32f411xe.s | 2 | ||||
| -rw-r--r-- | ports/stm32f4/supervisor/port.c | 2 | ||||
| -rw-r--r-- | ports/stm32f4/tick.c | 33 | ||||
| -rw-r--r-- | shared-module/usb_hid/Device.c | 1 | ||||
| -rwxr-xr-x | supervisor/shared/memory.c | 2 | ||||
| -rw-r--r-- | supervisor/shared/usb/usb.c | 2 |
7 files changed, 34 insertions, 36 deletions
diff --git a/ports/stm32f4/Makefile b/ports/stm32f4/Makefile index 142973f53..90e81291f 100755 --- a/ports/stm32f4/Makefile +++ b/ports/stm32f4/Makefile @@ -62,18 +62,13 @@ CROSS_COMPILE = arm-none-eabi- INC += -I. INC += -I../.. INC += -I$(BUILD) -#keep? INC += -I$(BUILD)/genhdr -#HAL SPECIFIC -INC += -IcubeMXInc -INC += -IcubeMXDrivers/STM32F4xx_HAL_Driver/Inc -INC += -IcubeMXDrivers/STM32F4xx_HAL_Driver/Inc/Legacy -INC += -IcubeMXDrivers/CMSIS/Device/ST/STM32F4xx/Include -INC += -IcubeMXDrivers/CMSIS/Include -INC += -IcubeMXDrivers/CMSIS/Include -#does order matter? -INC += -Iboards/$(BOARD) -#INC += -I./peripherals +INC += -I./cubeMXInc +INC += -I./cubeMXDrivers/STM32F4xx_HAL_Driver/Inc +INC += -I./cubeMXDrivers/STM32F4xx_HAL_Driver/Inc/Legacy +INC += -I./cubeMXDrivers/CMSIS/Device/ST/STM32F4xx/Include +INC += -I./cubeMXDrivers/CMSIS/Include +INC += -I./boards/$(BOARD) INC += -I../../lib/mp-readline INC += -I../../lib/tinyusb/src INC += -I../../supervisor/shared/usb @@ -118,7 +113,7 @@ CFLAGS += -D__START=main #TODO: add LD file? -LDFLAGS = $(CFLAGS) -nostartfiles -fshort-enums -Wl,-nostdlib -Wl,-T,$(LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs +LDFLAGS = $(CFLAGS) -fshort-enums -Wl,-nostdlib -Wl,-T,$(LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs LIBS := -lgcc -lc LDFLAGS += -mthumb -mcpu=cortex-m4 @@ -138,9 +133,10 @@ CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_STM32F4 -DCFG_TUD_CDC_RX_BUFSIZE=1024 -DCFG_TUD # source ###################################### +#cubeMXsrc/stm32f4xx_it.c \ +#cubeMXsrc/stm32f4xx_hal_msp.c \ + SRC_STM32 = \ - cubeMXsrc/stm32f4xx_it.c \ - cubeMXsrc/stm32f4xx_hal_msp.c \ cubeMXDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c \ cubeMXDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c \ cubeMXDrivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c \ @@ -164,6 +160,7 @@ SRC_C += \ background.c \ fatfs_port.c \ mphalport.c \ + tick.c \ boards/$(BOARD)/board.c \ lib/libc/string0.c \ lib/mp-readline/readline.c \ @@ -176,7 +173,8 @@ SRC_C += \ lib/utils/pyexec.c \ lib/utils/stdout_helpers.c \ lib/utils/sys_stdio_mphal.c \ - supervisor/shared/memory.c + supervisor/shared/memory.c \ + lib/tinyusb/src/portable/st/stm32f4/dcd_stm32f4.c # diff --git a/ports/stm32f4/startup_stm32f411xe.s b/ports/stm32f4/startup_stm32f411xe.s index 6079df95e..3aac640cb 100644 --- a/ports/stm32f4/startup_stm32f411xe.s +++ b/ports/stm32f4/startup_stm32f411xe.s @@ -108,7 +108,7 @@ LoopFillZerobss: /* Call the clock system intitialization function.*/ bl SystemInit /* Call static constructors */ - bl __libc_init_array +/* bl __libc_init_array */ /* Call the application's entry point.*/ bl main bx lr diff --git a/ports/stm32f4/supervisor/port.c b/ports/stm32f4/supervisor/port.c index df0019c06..93a297d0f 100644 --- a/ports/stm32f4/supervisor/port.c +++ b/ports/stm32f4/supervisor/port.c @@ -136,7 +136,7 @@ safe_mode_t port_init(void) { // huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE; // huart2.Init.OverSampling = UART_OVERSAMPLING_16; - HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_5); + HAL_GPIO_WritePin(GPIOA, GPIO_PIN_5, GPIO_PIN_SET); return NO_SAFE_MODE; } diff --git a/ports/stm32f4/tick.c b/ports/stm32f4/tick.c index 6d8fd13e0..41fdac6ff 100644 --- a/ports/stm32f4/tick.c +++ b/ports/stm32f4/tick.c @@ -30,7 +30,6 @@ #include "supervisor/filesystem.h" #include "shared-module/gamepad/__init__.h" #include "shared-bindings/microcontroller/Processor.h" -#include "nrf.h" // Global millisecond tick count volatile uint64_t ticks_ms = 0; @@ -54,31 +53,31 @@ void SysTick_Handler(void) { } void tick_init() { - uint32_t ticks_per_ms = common_hal_mcu_processor_get_frequency() / 1000; - SysTick_Config(ticks_per_ms); // interrupt is enabled + uint32_t ticks_per_ms = 16000000/ 1000; + //SysTick_Config(ticks_per_ms); // interrupt is enabled } void tick_delay(uint32_t us) { - uint32_t ticks_per_us = common_hal_mcu_processor_get_frequency() / 1000 / 1000; - uint32_t us_between_ticks = SysTick->VAL / ticks_per_us; - uint64_t start_ms = ticks_ms; - while (us > 1000) { - while (ticks_ms == start_ms) {} - us -= us_between_ticks; - start_ms = ticks_ms; - us_between_ticks = 1000; - } - while (SysTick->VAL > ((us_between_ticks - us) * ticks_per_us)) {} + // uint32_t ticks_per_us = 16000000 / 1000 / 1000; + // uint32_t us_between_ticks = SysTick->VAL / ticks_per_us; + // uint64_t start_ms = ticks_ms; + // while (us > 1000) { + // while (ticks_ms == start_ms) {} + // us -= us_between_ticks; + // start_ms = ticks_ms; + // us_between_ticks = 1000; + // } + //while (SysTick->VAL > ((us_between_ticks - us) * ticks_per_us)) {} } // us counts down! void current_tick(uint64_t* ms, uint32_t* us_until_ms) { - uint32_t ticks_per_us = common_hal_mcu_processor_get_frequency() / 1000 / 1000; + uint32_t ticks_per_us = 16000000 / 1000 / 1000; *ms = ticks_ms; - *us_until_ms = SysTick->VAL / ticks_per_us; + //*us_until_ms = SysTick->VAL / ticks_per_us; } void wait_until(uint64_t ms, uint32_t us_until_ms) { - uint32_t ticks_per_us = common_hal_mcu_processor_get_frequency() / 1000 / 1000; - while(ticks_ms <= ms && SysTick->VAL / ticks_per_us >= us_until_ms) {} + uint32_t ticks_per_us = 16000000 / 1000 / 1000; + //while(ticks_ms <= ms && SysTick->VAL / ticks_per_us >= us_until_ms) {} } diff --git a/shared-module/usb_hid/Device.c b/shared-module/usb_hid/Device.c index 0e256cb5e..a2a4c30ac 100644 --- a/shared-module/usb_hid/Device.c +++ b/shared-module/usb_hid/Device.c @@ -47,6 +47,7 @@ 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 11133415d..c9c4bc2d5 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/usb/usb.c b/supervisor/shared/usb/usb.c index 0678a3a3f..ec778e91c 100644 --- a/supervisor/shared/usb/usb.c +++ b/supervisor/shared/usb/usb.c @@ -41,7 +41,7 @@ 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 uint8_t raw_id[COMMON_HAL_MCU_PROCESSOR_UID_LENGTH]; - common_hal_mcu_processor_get_uid(raw_id); + //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'}; |
