diff --git a/firmware/c_board/bsp/HAL/.mxproject b/firmware/c_board/bsp/HAL/.mxproject index ca15d7f..b1cabcf 100644 --- a/firmware/c_board/bsp/HAL/.mxproject +++ b/firmware/c_board/bsp/HAL/.mxproject @@ -1,37 +1,39 @@ +[PreviousLibFiles] +LibFiles=Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_can.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_bus.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_rcc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_system.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_utils.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ramfunc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_gpio.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_dma.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_dmamux.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_pwr.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cortex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_cortex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h;Drivers/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_exti.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_exti.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_spi.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_spi.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_tim.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_usart.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_usb.h;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_can.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_can.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_bus.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_rcc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_system.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_utils.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ramfunc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_gpio.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_dma.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_dmamux.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_pwr.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cortex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_cortex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h;Drivers/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_exti.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_exti.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_spi.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_spi.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_tim.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_usart.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_usb.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f407xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/system_stm32f4xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/system_stm32f4xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c;Drivers/CMSIS/Include/core_cm7.h;Drivers/CMSIS/Include/core_cm4.h;Drivers/CMSIS/Include/core_starmc1.h;Drivers/CMSIS/Include/core_cm85.h;Drivers/CMSIS/Include/cmsis_armclang_ltm.h;Drivers/CMSIS/Include/core_cm0plus.h;Drivers/CMSIS/Include/core_cm23.h;Drivers/CMSIS/Include/cmsis_compiler.h;Drivers/CMSIS/Include/cmsis_version.h;Drivers/CMSIS/Include/core_cm55.h;Drivers/CMSIS/Include/cmsis_armcc.h;Drivers/CMSIS/Include/core_cm33.h;Drivers/CMSIS/Include/core_armv81mml.h;Drivers/CMSIS/Include/core_armv8mml.h;Drivers/CMSIS/Include/core_sc000.h;Drivers/CMSIS/Include/core_cm0.h;Drivers/CMSIS/Include/mpu_armv7.h;Drivers/CMSIS/Include/core_cm1.h;Drivers/CMSIS/Include/tz_context.h;Drivers/CMSIS/Include/core_armv8mbl.h;Drivers/CMSIS/Include/core_cm3.h;Drivers/CMSIS/Include/core_cm35p.h;Drivers/CMSIS/Include/cmsis_armclang.h;Drivers/CMSIS/Include/cmsis_gcc.h;Drivers/CMSIS/Include/mpu_armv8.h;Drivers/CMSIS/Include/cachel1_armv7.h;Drivers/CMSIS/Include/pac_armv81.h;Drivers/CMSIS/Include/core_sc300.h;Drivers/CMSIS/Include/pmu_armv8.h;Drivers/CMSIS/Include/cmsis_iccarm.h; + +[PreviousUsedCMakes] +SourceFiles=Core/Src/main.c;Core/Src/gpio.c;Core/Src/can.c;Core/Src/dma.c;Core/Src/spi.c;Core/Src/tim.c;Core/Src/usart.c;Core/Src/usb_otg.c;Core/Src/stm32f4xx_it.c;Core/Src/stm32f4xx_hal_msp.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_can.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c;Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c;Core/Src/system_stm32f4xx.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_can.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c;Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c;Core/Src/system_stm32f4xx.c;;; +HeaderPath=Drivers/STM32F4xx_HAL_Driver/Inc;Drivers/STM32F4xx_HAL_Driver/Inc/Legacy;Drivers/CMSIS/Device/ST/STM32F4xx/Include;Drivers/CMSIS/Include;Core/Inc; +CDefines=USE_HAL_DRIVER;STM32F407xx;USE_HAL_DRIVER;USE_HAL_DRIVER; + [PreviousGenFiles] AdvancedFolderStructure=true -HeaderFileListSize=9 +HeaderFileListSize=10 HeaderFiles#0=../Core/Inc/gpio.h HeaderFiles#1=../Core/Inc/can.h -HeaderFiles#2=../Core/Inc/spi.h -HeaderFiles#3=../Core/Inc/tim.h -HeaderFiles#4=../Core/Inc/usart.h -HeaderFiles#5=../Core/Inc/usb_otg.h -HeaderFiles#6=../Core/Inc/stm32f4xx_it.h -HeaderFiles#7=../Core/Inc/stm32f4xx_hal_conf.h -HeaderFiles#8=../Core/Inc/main.h +HeaderFiles#2=../Core/Inc/dma.h +HeaderFiles#3=../Core/Inc/spi.h +HeaderFiles#4=../Core/Inc/tim.h +HeaderFiles#5=../Core/Inc/usart.h +HeaderFiles#6=../Core/Inc/usb_otg.h +HeaderFiles#7=../Core/Inc/stm32f4xx_it.h +HeaderFiles#8=../Core/Inc/stm32f4xx_hal_conf.h +HeaderFiles#9=../Core/Inc/main.h HeaderFolderListSize=1 HeaderPath#0=../Core/Inc HeaderFiles=; -SourceFileListSize=9 +SourceFileListSize=10 SourceFiles#0=../Core/Src/gpio.c SourceFiles#1=../Core/Src/can.c -SourceFiles#2=../Core/Src/spi.c -SourceFiles#3=../Core/Src/tim.c -SourceFiles#4=../Core/Src/usart.c -SourceFiles#5=../Core/Src/usb_otg.c -SourceFiles#6=../Core/Src/stm32f4xx_it.c -SourceFiles#7=../Core/Src/stm32f4xx_hal_msp.c -SourceFiles#8=../Core/Src/main.c +SourceFiles#2=../Core/Src/dma.c +SourceFiles#3=../Core/Src/spi.c +SourceFiles#4=../Core/Src/tim.c +SourceFiles#5=../Core/Src/usart.c +SourceFiles#6=../Core/Src/usb_otg.c +SourceFiles#7=../Core/Src/stm32f4xx_it.c +SourceFiles#8=../Core/Src/stm32f4xx_hal_msp.c +SourceFiles#9=../Core/Src/main.c SourceFolderListSize=1 SourcePath#0=../Core/Src SourceFiles=; -[PreviousLibFiles] -LibFiles=Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_can.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_bus.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_rcc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_system.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_utils.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ramfunc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_gpio.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_dma.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_dmamux.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_pwr.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cortex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_cortex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h;Drivers/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_exti.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_exti.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_spi.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_spi.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_tim.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_usart.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_usb.h;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_can.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_can.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_bus.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_rcc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_system.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_utils.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ramfunc.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_gpio.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_dma.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_dmamux.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_pwr.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_cortex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_cortex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h;Drivers/STM32F4xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_exti.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_exti.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_spi.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_spi.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_tim.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_uart.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_usart.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd_ex.h;Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_usb.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f407xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/system_stm32f4xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Include/system_stm32f4xx.h;Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c;Drivers/CMSIS/Include/core_cm7.h;Drivers/CMSIS/Include/core_cm4.h;Drivers/CMSIS/Include/core_starmc1.h;Drivers/CMSIS/Include/core_cm85.h;Drivers/CMSIS/Include/cmsis_armclang_ltm.h;Drivers/CMSIS/Include/core_cm0plus.h;Drivers/CMSIS/Include/core_cm23.h;Drivers/CMSIS/Include/cmsis_compiler.h;Drivers/CMSIS/Include/cmsis_version.h;Drivers/CMSIS/Include/core_cm55.h;Drivers/CMSIS/Include/cmsis_armcc.h;Drivers/CMSIS/Include/core_cm33.h;Drivers/CMSIS/Include/core_armv81mml.h;Drivers/CMSIS/Include/core_armv8mml.h;Drivers/CMSIS/Include/core_sc000.h;Drivers/CMSIS/Include/core_cm0.h;Drivers/CMSIS/Include/mpu_armv7.h;Drivers/CMSIS/Include/core_cm1.h;Drivers/CMSIS/Include/tz_context.h;Drivers/CMSIS/Include/core_armv8mbl.h;Drivers/CMSIS/Include/core_cm3.h;Drivers/CMSIS/Include/core_cm35p.h;Drivers/CMSIS/Include/cmsis_armclang.h;Drivers/CMSIS/Include/cmsis_gcc.h;Drivers/CMSIS/Include/mpu_armv8.h;Drivers/CMSIS/Include/cachel1_armv7.h;Drivers/CMSIS/Include/pac_armv81.h;Drivers/CMSIS/Include/core_sc300.h;Drivers/CMSIS/Include/pmu_armv8.h;Drivers/CMSIS/Include/cmsis_iccarm.h; - -[PreviousUsedCMakes] -SourceFiles=Core/Src/main.c;Core/Src/gpio.c;Core/Src/can.c;Core/Src/spi.c;Core/Src/tim.c;Core/Src/usart.c;Core/Src/usb_otg.c;Core/Src/stm32f4xx_it.c;Core/Src/stm32f4xx_hal_msp.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_can.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c;Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c;Core/Src/system_stm32f4xx.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_can.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c;Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c;Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c;Core/Src/system_stm32f4xx.c;;; -HeaderPath=Drivers/STM32F4xx_HAL_Driver/Inc;Drivers/STM32F4xx_HAL_Driver/Inc/Legacy;Drivers/CMSIS/Device/ST/STM32F4xx/Include;Drivers/CMSIS/Include;Core/Inc; -CDefines=USE_HAL_DRIVER;STM32F407xx;USE_HAL_DRIVER;USE_HAL_DRIVER; - diff --git a/firmware/c_board/bsp/HAL/Core/Inc/dma.h b/firmware/c_board/bsp/HAL/Core/Inc/dma.h new file mode 100644 index 0000000..cbf3957 --- /dev/null +++ b/firmware/c_board/bsp/HAL/Core/Inc/dma.h @@ -0,0 +1,52 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file dma.h + * @brief This file contains all the function prototypes for + * the dma.c file + ****************************************************************************** + * @attention + * + * Copyright (c) 2026 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __DMA_H__ +#define __DMA_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* DMA memory to memory transfer handles -------------------------------------*/ + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_DMA_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __DMA_H__ */ + diff --git a/firmware/c_board/bsp/HAL/Core/Inc/main.h b/firmware/c_board/bsp/HAL/Core/Inc/main.h index 74e1928..3616f0a 100644 --- a/firmware/c_board/bsp/HAL/Core/Inc/main.h +++ b/firmware/c_board/bsp/HAL/Core/Inc/main.h @@ -32,9 +32,10 @@ extern "C" { /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ +#include "stm32f407xx.h" // IWYU pragma: export +#include "stm32f4xx.h" // IWYU pragma: export #include "stm32f4xx_hal.h" // IWYU pragma: export #include "stm32f4xx_hal_def.h" // IWYU pragma: export -#include "stm32f407xx.h" // IWYU pragma: export #ifdef HAL_RCC_MODULE_ENABLED # include "stm32f4xx_hal_rcc.h" // IWYU pragma: export diff --git a/firmware/c_board/bsp/HAL/Core/Inc/stm32f4xx_it.h b/firmware/c_board/bsp/HAL/Core/Inc/stm32f4xx_it.h index 7ceeb96..4fa4fd3 100644 --- a/firmware/c_board/bsp/HAL/Core/Inc/stm32f4xx_it.h +++ b/firmware/c_board/bsp/HAL/Core/Inc/stm32f4xx_it.h @@ -61,6 +61,8 @@ void EXTI9_5_IRQHandler(void); void SPI1_IRQHandler(void); void USART1_IRQHandler(void); void USART3_IRQHandler(void); +void DMA2_Stream0_IRQHandler(void); +void DMA2_Stream3_IRQHandler(void); void CAN2_RX0_IRQHandler(void); void OTG_FS_IRQHandler(void); void USART6_IRQHandler(void); diff --git a/firmware/c_board/bsp/HAL/Core/Src/dma.c b/firmware/c_board/bsp/HAL/Core/Src/dma.c new file mode 100644 index 0000000..fbd3855 --- /dev/null +++ b/firmware/c_board/bsp/HAL/Core/Src/dma.c @@ -0,0 +1,58 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file dma.c + * @brief This file provides code for the configuration + * of all the requested memory to memory DMA transfers. + ****************************************************************************** + * @attention + * + * Copyright (c) 2026 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "dma.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +/*----------------------------------------------------------------------------*/ +/* Configure DMA */ +/*----------------------------------------------------------------------------*/ + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/** + * Enable DMA controller clock + */ +void MX_DMA_Init(void) +{ + + /* DMA controller clock enable */ + __HAL_RCC_DMA2_CLK_ENABLE(); + + /* DMA interrupt init */ + /* DMA2_Stream0_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(DMA2_Stream0_IRQn, 4, 0); + HAL_NVIC_EnableIRQ(DMA2_Stream0_IRQn); + /* DMA2_Stream3_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(DMA2_Stream3_IRQn, 4, 0); + HAL_NVIC_EnableIRQ(DMA2_Stream3_IRQn); + +} + +/* USER CODE BEGIN 2 */ + +/* USER CODE END 2 */ + diff --git a/firmware/c_board/bsp/HAL/Core/Src/gpio.c b/firmware/c_board/bsp/HAL/Core/Src/gpio.c index 81474e5..d5f5a2c 100644 --- a/firmware/c_board/bsp/HAL/Core/Src/gpio.c +++ b/firmware/c_board/bsp/HAL/Core/Src/gpio.c @@ -67,7 +67,7 @@ void MX_GPIO_Init(void) /*Configure GPIO pins : INT1_ACC_Pin INT1_GYRO_Pin */ GPIO_InitStruct.Pin = INT1_ACC_Pin|INT1_GYRO_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING; + GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING; GPIO_InitStruct.Pull = GPIO_NOPULL; HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); diff --git a/firmware/c_board/bsp/HAL/Core/Src/main.c b/firmware/c_board/bsp/HAL/Core/Src/main.c index d62149a..057d6f3 100644 --- a/firmware/c_board/bsp/HAL/Core/Src/main.c +++ b/firmware/c_board/bsp/HAL/Core/Src/main.c @@ -19,6 +19,7 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "can.h" +#include "dma.h" #include "spi.h" #include "tim.h" #include "usart.h" @@ -96,6 +97,7 @@ int main(void) /* Initialize all configured peripherals */ MX_GPIO_Init(); + MX_DMA_Init(); MX_SPI1_Init(); MX_CAN1_Init(); MX_CAN2_Init(); diff --git a/firmware/c_board/bsp/HAL/Core/Src/spi.c b/firmware/c_board/bsp/HAL/Core/Src/spi.c index 2b63ae9..f15ffd0 100644 --- a/firmware/c_board/bsp/HAL/Core/Src/spi.c +++ b/firmware/c_board/bsp/HAL/Core/Src/spi.c @@ -25,6 +25,8 @@ /* USER CODE END 0 */ SPI_HandleTypeDef hspi1; +DMA_HandleTypeDef hdma_spi1_rx; +DMA_HandleTypeDef hdma_spi1_tx; /* SPI1 init function */ void MX_SPI1_Init(void) @@ -92,6 +94,43 @@ void HAL_SPI_MspInit(SPI_HandleTypeDef* spiHandle) GPIO_InitStruct.Alternate = GPIO_AF5_SPI1; HAL_GPIO_Init(SPI1_MOSI_GPIO_Port, &GPIO_InitStruct); + /* SPI1 DMA Init */ + /* SPI1_RX Init */ + hdma_spi1_rx.Instance = DMA2_Stream0; + hdma_spi1_rx.Init.Channel = DMA_CHANNEL_3; + hdma_spi1_rx.Init.Direction = DMA_PERIPH_TO_MEMORY; + hdma_spi1_rx.Init.PeriphInc = DMA_PINC_DISABLE; + hdma_spi1_rx.Init.MemInc = DMA_MINC_ENABLE; + hdma_spi1_rx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; + hdma_spi1_rx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; + hdma_spi1_rx.Init.Mode = DMA_NORMAL; + hdma_spi1_rx.Init.Priority = DMA_PRIORITY_MEDIUM; + hdma_spi1_rx.Init.FIFOMode = DMA_FIFOMODE_DISABLE; + if (HAL_DMA_Init(&hdma_spi1_rx) != HAL_OK) + { + Error_Handler(); + } + + __HAL_LINKDMA(spiHandle,hdmarx,hdma_spi1_rx); + + /* SPI1_TX Init */ + hdma_spi1_tx.Instance = DMA2_Stream3; + hdma_spi1_tx.Init.Channel = DMA_CHANNEL_3; + hdma_spi1_tx.Init.Direction = DMA_MEMORY_TO_PERIPH; + hdma_spi1_tx.Init.PeriphInc = DMA_PINC_DISABLE; + hdma_spi1_tx.Init.MemInc = DMA_MINC_ENABLE; + hdma_spi1_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; + hdma_spi1_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; + hdma_spi1_tx.Init.Mode = DMA_NORMAL; + hdma_spi1_tx.Init.Priority = DMA_PRIORITY_MEDIUM; + hdma_spi1_tx.Init.FIFOMode = DMA_FIFOMODE_DISABLE; + if (HAL_DMA_Init(&hdma_spi1_tx) != HAL_OK) + { + Error_Handler(); + } + + __HAL_LINKDMA(spiHandle,hdmatx,hdma_spi1_tx); + /* SPI1 interrupt Init */ HAL_NVIC_SetPriority(SPI1_IRQn, 4, 0); HAL_NVIC_EnableIRQ(SPI1_IRQn); @@ -121,6 +160,10 @@ void HAL_SPI_MspDeInit(SPI_HandleTypeDef* spiHandle) HAL_GPIO_DeInit(SPI1_MOSI_GPIO_Port, SPI1_MOSI_Pin); + /* SPI1 DMA DeInit */ + HAL_DMA_DeInit(spiHandle->hdmarx); + HAL_DMA_DeInit(spiHandle->hdmatx); + /* SPI1 interrupt Deinit */ HAL_NVIC_DisableIRQ(SPI1_IRQn); /* USER CODE BEGIN SPI1_MspDeInit 1 */ diff --git a/firmware/c_board/bsp/HAL/Core/Src/stm32f4xx_it.c b/firmware/c_board/bsp/HAL/Core/Src/stm32f4xx_it.c index 569339d..c369aef 100644 --- a/firmware/c_board/bsp/HAL/Core/Src/stm32f4xx_it.c +++ b/firmware/c_board/bsp/HAL/Core/Src/stm32f4xx_it.c @@ -20,10 +20,10 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32f4xx_it.h" -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ -#include -/* USER CODE END Includes */ +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ +#include +/* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ /* USER CODE BEGIN TD */ @@ -58,6 +58,8 @@ /* External variables --------------------------------------------------------*/ extern CAN_HandleTypeDef hcan1; extern CAN_HandleTypeDef hcan2; +extern DMA_HandleTypeDef hdma_spi1_rx; +extern DMA_HandleTypeDef hdma_spi1_tx; extern SPI_HandleTypeDef hspi1; extern UART_HandleTypeDef huart1; extern UART_HandleTypeDef huart3; @@ -289,6 +291,34 @@ void USART3_IRQHandler(void) /* USER CODE END USART3_IRQn 1 */ } +/** + * @brief This function handles DMA2 stream0 global interrupt. + */ +void DMA2_Stream0_IRQHandler(void) +{ + /* USER CODE BEGIN DMA2_Stream0_IRQn 0 */ + + /* USER CODE END DMA2_Stream0_IRQn 0 */ + HAL_DMA_IRQHandler(&hdma_spi1_rx); + /* USER CODE BEGIN DMA2_Stream0_IRQn 1 */ + + /* USER CODE END DMA2_Stream0_IRQn 1 */ +} + +/** + * @brief This function handles DMA2 stream3 global interrupt. + */ +void DMA2_Stream3_IRQHandler(void) +{ + /* USER CODE BEGIN DMA2_Stream3_IRQn 0 */ + + /* USER CODE END DMA2_Stream3_IRQn 0 */ + HAL_DMA_IRQHandler(&hdma_spi1_tx); + /* USER CODE BEGIN DMA2_Stream3_IRQn 1 */ + + /* USER CODE END DMA2_Stream3_IRQn 1 */ +} + /** * @brief This function handles CAN2 RX0 interrupts. */ @@ -306,14 +336,14 @@ void CAN2_RX0_IRQHandler(void) /** * @brief This function handles USB On The Go FS global interrupt. */ -void OTG_FS_IRQHandler(void) -{ - /* USER CODE BEGIN OTG_FS_IRQn 0 */ - tusb_int_handler(0, true); - return; - - /* USER CODE END OTG_FS_IRQn 0 */ - HAL_PCD_IRQHandler(&hpcd_USB_OTG_FS); +void OTG_FS_IRQHandler(void) +{ + /* USER CODE BEGIN OTG_FS_IRQn 0 */ + tusb_int_handler(0, true); + return; + + /* USER CODE END OTG_FS_IRQn 0 */ + HAL_PCD_IRQHandler(&hpcd_USB_OTG_FS); /* USER CODE BEGIN OTG_FS_IRQn 1 */ /* USER CODE END OTG_FS_IRQn 1 */ diff --git a/firmware/c_board/bsp/HAL/cmake/stm32cubemx/CMakeLists.txt b/firmware/c_board/bsp/HAL/cmake/stm32cubemx/CMakeLists.txt index 7f72b50..a3981bc 100644 --- a/firmware/c_board/bsp/HAL/cmake/stm32cubemx/CMakeLists.txt +++ b/firmware/c_board/bsp/HAL/cmake/stm32cubemx/CMakeLists.txt @@ -22,6 +22,7 @@ set(MX_Application_Src ${CMAKE_CURRENT_SOURCE_DIR}/../../Core/Src/main.c ${CMAKE_CURRENT_SOURCE_DIR}/../../Core/Src/gpio.c ${CMAKE_CURRENT_SOURCE_DIR}/../../Core/Src/can.c + ${CMAKE_CURRENT_SOURCE_DIR}/../../Core/Src/dma.c ${CMAKE_CURRENT_SOURCE_DIR}/../../Core/Src/spi.c ${CMAKE_CURRENT_SOURCE_DIR}/../../Core/Src/tim.c ${CMAKE_CURRENT_SOURCE_DIR}/../../Core/Src/usart.c diff --git a/firmware/c_board/bsp/HAL/rmcs_slave.ioc b/firmware/c_board/bsp/HAL/rmcs_slave.ioc index 8b7ad2a..ef90236 100644 --- a/firmware/c_board/bsp/HAL/rmcs_slave.ioc +++ b/firmware/c_board/bsp/HAL/rmcs_slave.ioc @@ -18,6 +18,29 @@ CAN2.CalculateTimeQuantum=71.42857142857143 CAN2.IPParameters=CalculateTimeQuantum,CalculateTimeBit,CalculateBaudRate,BS1,BS2,Prescaler,NART CAN2.NART=DISABLE CAN2.Prescaler=3 +Dma.Request0=SPI1_RX +Dma.Request1=SPI1_TX +Dma.RequestsNb=2 +Dma.SPI1_RX.0.Direction=DMA_PERIPH_TO_MEMORY +Dma.SPI1_RX.0.FIFOMode=DMA_FIFOMODE_DISABLE +Dma.SPI1_RX.0.Instance=DMA2_Stream0 +Dma.SPI1_RX.0.MemDataAlignment=DMA_MDATAALIGN_BYTE +Dma.SPI1_RX.0.MemInc=DMA_MINC_ENABLE +Dma.SPI1_RX.0.Mode=DMA_NORMAL +Dma.SPI1_RX.0.PeriphDataAlignment=DMA_PDATAALIGN_BYTE +Dma.SPI1_RX.0.PeriphInc=DMA_PINC_DISABLE +Dma.SPI1_RX.0.Priority=DMA_PRIORITY_MEDIUM +Dma.SPI1_RX.0.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority,FIFOMode +Dma.SPI1_TX.1.Direction=DMA_MEMORY_TO_PERIPH +Dma.SPI1_TX.1.FIFOMode=DMA_FIFOMODE_DISABLE +Dma.SPI1_TX.1.Instance=DMA2_Stream3 +Dma.SPI1_TX.1.MemDataAlignment=DMA_MDATAALIGN_BYTE +Dma.SPI1_TX.1.MemInc=DMA_MINC_ENABLE +Dma.SPI1_TX.1.Mode=DMA_NORMAL +Dma.SPI1_TX.1.PeriphDataAlignment=DMA_PDATAALIGN_BYTE +Dma.SPI1_TX.1.PeriphInc=DMA_PINC_DISABLE +Dma.SPI1_TX.1.Priority=DMA_PRIORITY_MEDIUM +Dma.SPI1_TX.1.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority,FIFOMode File.Version=6 GPIO.groupedBy=Group By Peripherals KeepUserPlacement=false @@ -25,16 +48,17 @@ Mcu.CPN=STM32F407IGH6 Mcu.Family=STM32F4 Mcu.IP0=CAN1 Mcu.IP1=CAN2 -Mcu.IP10=USB_OTG_FS -Mcu.IP2=NVIC -Mcu.IP3=RCC -Mcu.IP4=SPI1 -Mcu.IP5=SYS -Mcu.IP6=TIM5 -Mcu.IP7=USART1 -Mcu.IP8=USART3 -Mcu.IP9=USART6 -Mcu.IPNb=11 +Mcu.IP10=USART6 +Mcu.IP11=USB_OTG_FS +Mcu.IP2=DMA +Mcu.IP3=NVIC +Mcu.IP4=RCC +Mcu.IP5=SPI1 +Mcu.IP6=SYS +Mcu.IP7=TIM5 +Mcu.IP8=USART1 +Mcu.IP9=USART3 +Mcu.IPNb=12 Mcu.Name=STM32F407I(E-G)Hx Mcu.Package=UFBGA176 Mcu.Pin0=PB5 @@ -74,6 +98,8 @@ MxDb.Version=DB.6.0.161 NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false NVIC.CAN1_RX0_IRQn=true\:2\:0\:true\:false\:true\:true\:true\:true NVIC.CAN2_RX0_IRQn=true\:2\:0\:true\:false\:true\:true\:true\:true +NVIC.DMA2_Stream0_IRQn=true\:4\:0\:true\:false\:true\:false\:true\:true +NVIC.DMA2_Stream3_IRQn=true\:4\:0\:true\:false\:true\:false\:true\:true NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false NVIC.EXTI4_IRQn=true\:4\:0\:true\:false\:true\:true\:true\:true NVIC.EXTI9_5_IRQn=true\:4\:0\:true\:false\:true\:true\:true\:true @@ -150,12 +176,14 @@ PC10.Signal=USART3_TX PC11.Locked=true PC11.Mode=Asynchronous PC11.Signal=USART3_RX -PC4.GPIOParameters=GPIO_Label +PC4.GPIOParameters=GPIO_Label,GPIO_ModeDefaultEXTI PC4.GPIO_Label=INT1_ACC +PC4.GPIO_ModeDefaultEXTI=GPIO_MODE_IT_FALLING PC4.Locked=true PC4.Signal=GPXTI4 -PC5.GPIOParameters=GPIO_Label +PC5.GPIOParameters=GPIO_Label,GPIO_ModeDefaultEXTI PC5.GPIO_Label=INT1_GYRO +PC5.GPIO_ModeDefaultEXTI=GPIO_MODE_IT_FALLING PC5.Locked=true PC5.Signal=GPXTI5 PCC.Checker=false @@ -229,7 +257,7 @@ ProjectManager.ToolChainLocation= ProjectManager.UAScriptAfterPath= ProjectManager.UAScriptBeforePath= ProjectManager.UnderRoot=false -ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_SPI1_Init-SPI1-false-HAL-true,4-MX_USB_DEVICE_Init-USB_DEVICE-false-HAL-false,5-MX_CAN1_Init-CAN1-false-HAL-true,6-MX_CAN2_Init-CAN2-false-HAL-true,7-MX_USART1_UART_Init-USART1-false-HAL-true,8-MX_USART3_UART_Init-USART3-false-HAL-true,9-MX_USART6_UART_Init-USART6-false-HAL-true,10-MX_TIM5_Init-TIM5-false-HAL-true +ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_DMA_Init-DMA-false-HAL-true,4-MX_SPI1_Init-SPI1-false-HAL-true,5-MX_CAN1_Init-CAN1-false-HAL-true,6-MX_CAN2_Init-CAN2-false-HAL-true,7-MX_USART1_UART_Init-USART1-false-HAL-true,8-MX_USART3_UART_Init-USART3-false-HAL-true,9-MX_USART6_UART_Init-USART6-false-HAL-true,10-MX_TIM5_Init-TIM5-false-HAL-true,11-MX_USB_OTG_FS_PCD_Init-USB_OTG_FS-false-HAL-true RCC.48MHZClocksFreq_Value=48000000 RCC.AHBFreq_Value=168000000 RCC.APB1CLKDivider=RCC_HCLK_DIV4 diff --git a/firmware/c_board/src/app.cpp b/firmware/c_board/src/app.cpp index a87818d..9a89af4 100644 --- a/firmware/c_board/src/app.cpp +++ b/firmware/c_board/src/app.cpp @@ -7,6 +7,7 @@ #include "firmware/c_board/src/led/led.hpp" #include "firmware/c_board/src/spi/bmi088/accel.hpp" #include "firmware/c_board/src/spi/bmi088/gyro.hpp" +#include "firmware/c_board/src/spi/spi.hpp" #include "firmware/c_board/src/uart/uart.hpp" #include "firmware/c_board/src/usb/vendor.hpp" #include "firmware/c_board/src/utility/interrupt_lock.hpp" @@ -41,6 +42,8 @@ App::App() { usb::vendor->try_transmit(); can::can2->try_transmit(); usb::vendor->try_transmit(); + spi::spi1->update(); + usb::vendor->try_transmit(); uart::uart1->try_transmit(); usb::vendor->try_transmit(); uart::uart2->try_transmit(); diff --git a/firmware/c_board/src/spi/bmi088/accel.hpp b/firmware/c_board/src/spi/bmi088/accel.hpp index 4708084..3c0ba6d 100644 --- a/firmware/c_board/src/spi/bmi088/accel.hpp +++ b/firmware/c_board/src/spi/bmi088/accel.hpp @@ -108,9 +108,11 @@ class Accelerometer final void data_ready_callback() { read_async(RegisterAddress::kAccXLsb, 6); } private: - void transmit_receive_async_callback(uint8_t* rx_buffer, size_t size) override { - auto& data = parse_rx_data(rx_buffer, size); - handle_uplink(usb::vendor->serializer(), data); + void transmit_receive_async_callback(size_t size) override { + if (size) [[likely]] { + auto& data = parse_rx_data(spi_.rx_buffer, size); + handle_uplink(usb::vendor->serializer(), data); + } spi_.unlock(); } diff --git a/firmware/c_board/src/spi/bmi088/gyro.hpp b/firmware/c_board/src/spi/bmi088/gyro.hpp index 344f50c..225008e 100644 --- a/firmware/c_board/src/spi/bmi088/gyro.hpp +++ b/firmware/c_board/src/spi/bmi088/gyro.hpp @@ -103,9 +103,11 @@ class Gyroscope final void data_ready_callback() { read_async(RegisterAddress::kRateXLsb, 6); } private: - void transmit_receive_async_callback(uint8_t* rx_buffer, size_t size) override { - auto& data = parse_rx_data(rx_buffer, size); - handle_uplink(usb::vendor->serializer(), data); + void transmit_receive_async_callback(size_t size) override { + if (size) [[likely]] { + auto& data = parse_rx_data(spi_.rx_buffer, size); + handle_uplink(usb::vendor->serializer(), data); + } spi_.unlock(); } diff --git a/firmware/c_board/src/spi/spi.cpp b/firmware/c_board/src/spi/spi.cpp index 1b23078..25d0b2a 100644 --- a/firmware/c_board/src/spi/spi.cpp +++ b/firmware/c_board/src/spi/spi.cpp @@ -1,12 +1,32 @@ #include "firmware/c_board/src/spi/spi.hpp" +#include #include +#include "core/src/utility/assert.hpp" + namespace librmcs::firmware::spi { -extern "C" void HAL_SPI_TxRxCpltCallback(SPI_HandleTypeDef* hspi) { - if (hspi == &hspi1) { - spi1->transmit_receive_async_callback(); +void Spi::dma_transfer_complete_callback_global(DMA_HandleTypeDef* hal_dma_handle) { + if (hal_dma_handle->Parent == &hspi1) { + spi1->dma_transfer_complete_callback(); + } +} + +void Spi::dma_error_callback_global(DMA_HandleTypeDef* hal_dma_handle) { + if (hal_dma_handle->Parent == &hspi1) { + spi1->transmit_receive_async_callback(false); + } +} + +extern "C" void HAL_SPI_TxRxCpltCallback(SPI_HandleTypeDef*) { + core::utility::assert_failed_always(); +} + +// NOLINTNEXTLINE(readability-inconsistent-declaration-parameter-name) +extern "C" void HAL_SPI_ErrorCallback(SPI_HandleTypeDef* hal_spi_handle) { + if (hal_spi_handle == &hspi1) { + spi1->transmit_receive_async_callback(false); } } diff --git a/firmware/c_board/src/spi/spi.hpp b/firmware/c_board/src/spi/spi.hpp index 5283f31..a23fb3e 100644 --- a/firmware/c_board/src/spi/spi.hpp +++ b/firmware/c_board/src/spi/spi.hpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include @@ -29,7 +30,7 @@ class SpiModule : private core::utility::Immovable { virtual ~SpiModule() = default; protected: - virtual void transmit_receive_async_callback(uint8_t* rx_buffer, size_t size) = 0; + virtual void transmit_receive_async_callback(size_t size) = 0; GPIO_TypeDef* const chip_select_port_; const uint16_t chip_select_pin_; @@ -42,7 +43,9 @@ class Spi : private core::utility::Immovable { using Lazy = utility::Lazy; explicit Spi(SPI_HandleTypeDef* hal_spi_handle) - : hal_spi_handle_(hal_spi_handle) {} + : hal_spi_handle_(hal_spi_handle) { + init_dma_transfer(); + } bool is_locked() const { return locking_.test(std::memory_order::acquire); } @@ -54,7 +57,7 @@ class Spi : private core::utility::Immovable { } void transmit_receive(SpiModule& module, size_t size) { - core::utility::assert_debug(size <= kMaxTransferSize); + core::utility::assert_debug(0 < size && size <= kMaxTransferSize); core::utility::assert_debug_lazy([&]() noexcept { return is_locked() && hal_ready(); }); begin_transfer(module, size); @@ -68,19 +71,44 @@ class Spi : private core::utility::Immovable { } void transmit_receive_async(SpiModule& module, size_t size) { - core::utility::assert_debug(size <= kMaxTransferSize); + core::utility::assert_debug(0 < size && size <= kMaxTransferSize); core::utility::assert_debug_lazy([&]() noexcept { return is_locked() && hal_ready(); }); begin_transfer(module, size); - core::utility::assert_debug( - HAL_SPI_TransmitReceive_IT(hal_spi_handle_, tx_buffer, rx_buffer, tx_rx_size_) - == HAL_OK); + trigger_dma(); + } + + void dma_transfer_complete_callback() { + active_dma_count_.fetch_sub(1, std::memory_order::release); + } + + void update() { + if (active_dma_count_.load(std::memory_order::acquire) == 0 + && !__HAL_SPI_GET_FLAG(hal_spi_handle_, SPI_FLAG_BSY)) { + transmit_receive_async_callback(true); + } } - void transmit_receive_async_callback() { + void transmit_receive_async_callback(bool success) { + // Fail-fast in debug builds + core::utility::assert_debug_lazy([&]() noexcept { return success; }); + + // Release fallback: cleanup + if (!success) [[unlikely]] { + HAL_DMA_Abort(hal_spi_handle_->hdmarx); + HAL_DMA_Abort(hal_spi_handle_->hdmatx); + } + + active_dma_count_.store(kDmaNotPerformed, std::memory_order::relaxed); + + CLEAR_BIT(hal_spi_handle_->Instance->CR2, SPI_CR2_TXDMAEN | SPI_CR2_RXDMAEN); + hal_spi_handle_->TxXferCount = 0; + hal_spi_handle_->RxXferCount = 0; + hal_spi_handle_->State = HAL_SPI_STATE_READY; + if (auto* module = finish_transfer()) - module->transmit_receive_async_callback(rx_buffer, tx_rx_size_); + module->transmit_receive_async_callback(success ? tx_rx_size_ : 0); } alignas(4) uint8_t tx_buffer[kMaxTransferSize]; @@ -89,6 +117,53 @@ class Spi : private core::utility::Immovable { private: bool hal_ready() const { return hal_spi_handle_->State == HAL_SPI_STATE_READY; } + void init_dma_transfer() { + hal_spi_handle_->pTxBuffPtr = tx_buffer; + hal_spi_handle_->pRxBuffPtr = rx_buffer; + hal_spi_handle_->RxISR = nullptr; + hal_spi_handle_->TxISR = nullptr; + + hal_spi_handle_->hdmarx->XferHalfCpltCallback = nullptr; + hal_spi_handle_->hdmarx->XferCpltCallback = dma_transfer_complete_callback_global; + hal_spi_handle_->hdmarx->XferErrorCallback = dma_error_callback_global; + hal_spi_handle_->hdmarx->XferAbortCallback = nullptr; + + hal_spi_handle_->hdmatx->XferHalfCpltCallback = nullptr; + hal_spi_handle_->hdmatx->XferCpltCallback = dma_transfer_complete_callback_global; + hal_spi_handle_->hdmatx->XferErrorCallback = dma_error_callback_global; + hal_spi_handle_->hdmatx->XferAbortCallback = nullptr; + + __HAL_SPI_ENABLE_IT(hal_spi_handle_, SPI_IT_ERR); + + if ((hal_spi_handle_->Instance->CR1 & SPI_CR1_SPE) != SPI_CR1_SPE) { + __HAL_SPI_ENABLE(hal_spi_handle_); + } + } + + void trigger_dma() { + hal_spi_handle_->State = HAL_SPI_STATE_BUSY_TX_RX; + hal_spi_handle_->TxXferSize = tx_rx_size_; + hal_spi_handle_->TxXferCount = tx_rx_size_; + hal_spi_handle_->RxXferSize = tx_rx_size_; + hal_spi_handle_->RxXferCount = tx_rx_size_; + SET_BIT(hal_spi_handle_->Instance->CR2, SPI_CR2_RXDMAEN | SPI_CR2_TXDMAEN); + + active_dma_count_.store(2, std::memory_order::relaxed); + + core::utility::assert_debug( + HAL_DMA_Start_IT( + hal_spi_handle_->hdmarx, + reinterpret_cast(&hal_spi_handle_->Instance->DR), + reinterpret_cast(rx_buffer), tx_rx_size_) + == HAL_OK); + + core::utility::assert_debug( + HAL_DMA_Start_IT( + hal_spi_handle_->hdmatx, reinterpret_cast(tx_buffer), + reinterpret_cast(&hal_spi_handle_->Instance->DR), tx_rx_size_) + == HAL_OK); + } + void begin_transfer(SpiModule& module, size_t size) { spi_module_ = &module; tx_rx_size_ = static_cast(size); @@ -117,10 +192,16 @@ class Spi : private core::utility::Immovable { spi_module_->chip_select_port_, spi_module_->chip_select_pin_, GPIO_PIN_SET); } + static void dma_transfer_complete_callback_global(DMA_HandleTypeDef* hal_dma_handle); + static void dma_error_callback_global(DMA_HandleTypeDef* hal_dma_handle); + SPI_HandleTypeDef* hal_spi_handle_; std::atomic_flag locking_; + static constexpr int8_t kDmaNotPerformed = std::numeric_limits::max(); + std::atomic active_dma_count_ = kDmaNotPerformed; + SpiModule* spi_module_{nullptr}; uint16_t tx_rx_size_{0}; }; diff --git a/firmware/c_board/src/utility/assert.cpp b/firmware/c_board/src/utility/assert.cpp index 4c9f97b..ed3f7b0 100644 --- a/firmware/c_board/src/utility/assert.cpp +++ b/firmware/c_board/src/utility/assert.cpp @@ -2,17 +2,42 @@ #include +#include + +#include "firmware/c_board/src/utility/interrupt_lock.hpp" + namespace librmcs::core::utility { const char* volatile assert_file = nullptr; volatile unsigned int assert_line = 0; const char* volatile assert_function = nullptr; +namespace { +inline void force_led_red() noexcept { + __HAL_RCC_GPIOH_CLK_ENABLE(); + + GPIO_InitTypeDef gpio_init = {}; + gpio_init.Pin = LED_R_Pin | LED_G_Pin | LED_B_Pin; + gpio_init.Mode = GPIO_MODE_OUTPUT_PP; + gpio_init.Pull = GPIO_NOPULL; + gpio_init.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(GPIOH, &gpio_init); + + HAL_GPIO_WritePin(LED_R_GPIO_Port, LED_R_Pin, GPIO_PIN_SET); + HAL_GPIO_WritePin(LED_G_GPIO_Port, LED_G_Pin, GPIO_PIN_RESET); + HAL_GPIO_WritePin(LED_B_GPIO_Port, LED_B_Pin, GPIO_PIN_RESET); +} +} // namespace + [[noreturn]] void assert_func(const std::source_location& location) { + firmware::utility::InterruptMutex::lock(); + assert_file = location.file_name(); assert_line = location.line(); assert_function = location.function_name(); + force_led_red(); + __builtin_trap(); } diff --git a/firmware/rmcs_board/src/spi/bmi088/accel.hpp b/firmware/rmcs_board/src/spi/bmi088/accel.hpp index bf31088..0ef1be4 100644 --- a/firmware/rmcs_board/src/spi/bmi088/accel.hpp +++ b/firmware/rmcs_board/src/spi/bmi088/accel.hpp @@ -107,9 +107,11 @@ class Accelerometer final void data_ready_callback() { read_async(RegisterAddress::kAccXLsb, 6); } private: - void transmit_receive_async_callback(std::byte* rx_buffer, std::size_t size) override { - auto& data = parse_rx_data(rx_buffer, size); - handle_uplink(usb::vendor->serializer(), data); + void transmit_receive_async_callback(std::size_t size) override { + if (size) [[likely]] { + auto& data = parse_rx_data(spi_.rx_buffer, size); + handle_uplink(usb::vendor->serializer(), data); + } spi_.unlock(); } diff --git a/firmware/rmcs_board/src/spi/bmi088/gyro.hpp b/firmware/rmcs_board/src/spi/bmi088/gyro.hpp index de4516c..2c5e3da 100644 --- a/firmware/rmcs_board/src/spi/bmi088/gyro.hpp +++ b/firmware/rmcs_board/src/spi/bmi088/gyro.hpp @@ -101,9 +101,11 @@ class Gyroscope final void data_ready_callback() { read_async(RegisterAddress::kRateXLsb, 6); } private: - void transmit_receive_async_callback(std::byte* rx_buffer, std::size_t size) override { - auto& data = parse_rx_data(rx_buffer, size); - handle_uplink(usb::vendor->serializer(), data); + void transmit_receive_async_callback(std::size_t size) override { + if (size) [[likely]] { + auto& data = parse_rx_data(spi_.rx_buffer, size); + handle_uplink(usb::vendor->serializer(), data); + } spi_.unlock(); } diff --git a/firmware/rmcs_board/src/spi/spi.hpp b/firmware/rmcs_board/src/spi/spi.hpp index bd199bc..0cb0a41 100644 --- a/firmware/rmcs_board/src/spi/spi.hpp +++ b/firmware/rmcs_board/src/spi/spi.hpp @@ -40,7 +40,7 @@ class SpiModule { virtual ~SpiModule() = default; protected: - virtual void transmit_receive_async_callback(std::byte* rx_buffer, std::size_t size) = 0; + virtual void transmit_receive_async_callback(std::size_t size) = 0; ChipSelectPin chip_select_pin_; }; @@ -133,7 +133,7 @@ class Spi : private core::utility::Immovable { void transmit_receive_async_callback() { if (auto* module = finish_transfer()) - module->transmit_receive_async_callback(rx_buffer, tx_rx_size_); + module->transmit_receive_async_callback(tx_rx_size_); } void unlock() {