Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
d11e9edf36 | |||
4ffcff9f1b | |||
20a463febf | |||
d280ca2a05 | |||
6787001a2d | |||
61abe568b4 |
229
.gitignore
vendored
229
.gitignore
vendored
|
@ -1,222 +1,9 @@
|
|||
WpfApp1/.vs/WpfApp1/FileContentIndex/7ce5a04a-68b0-4b93-a3a9-5ba64bbb8303.vsidx
|
||||
WpfApp1/.vs/WpfApp1/v16/.suo
|
||||
WpfApp1/.vs/WpfApp1/v17/.suo
|
||||
WpfApp1/.vs/WpfApp1/v17/Preview/Browse.VC.db
|
||||
WpfApp1/WpfApp1/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs
|
||||
WpfApp1/WpfApp1/obj/Debug/App.g.cs
|
||||
WpfApp1/WpfApp1/obj/Debug/App.g.i.cs
|
||||
WpfApp1/WpfApp1/obj/Debug/DesignTimeResolveAssemblyReferences.cache
|
||||
WpfApp1/WpfApp1/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
|
||||
WpfApp1/WpfApp1/obj/Debug/MainWindow.baml
|
||||
WpfApp1/WpfApp1/obj/Debug/MainWindow.g.cs
|
||||
WpfApp1/WpfApp1/obj/Debug/MainWindow.g.i.cs
|
||||
WpfApp1/WpfApp1/obj/Debug/SeniorWindow.g.i.cs
|
||||
WpfApp1/WpfApp1/obj/Debug/WpfApp1_MarkupCompile.cache
|
||||
WpfApp1/WpfApp1/obj/Debug/WpfApp1_MarkupCompile.i.cache
|
||||
WpfApp1/WpfApp1/obj/Debug/WpfApp1.csproj.AssemblyReference.cache
|
||||
WpfApp1/WpfApp1/obj/Debug/WpfApp1.csproj.CoreCompileInputs.cache
|
||||
WpfApp1/WpfApp1/obj/Debug/WpfApp1.csproj.FileListAbsolute.txt
|
||||
WpfApp1/WpfApp1/obj/Debug/WpfApp1.csproj.GenerateResource.cache
|
||||
WpfApp1/WpfApp1/obj/Debug/WpfApp1.csproj.SuggestedBindingRedirects.cache
|
||||
WpfApp1/WpfApp1/obj/Debug/WpfApp1.exe
|
||||
WpfApp1/WpfApp1/obj/Debug/WpfApp1.g.resources
|
||||
WpfApp1/WpfApp1/obj/Debug/WpfApp1.pdb
|
||||
WpfApp1/WpfApp1/obj/Debug/WpfApp1.Properties.Resources.resources
|
||||
WpfApp1/WpfApp1/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll
|
||||
WpfApp1/WpfApp1/bin/Debug/WpfApp1.exe
|
||||
WpfApp1/WpfApp1/bin/Debug/WpfApp1.exe.config
|
||||
WpfApp1/WpfApp1/bin/Debug/WpfApp1.pdb
|
||||
GD32F103C8T6/App/Output/Debug/Exe/App.bin
|
||||
GD32F103C8T6/App/Output/Debug/Exe/App.elf
|
||||
GD32F103C8T6/App/Output/Debug/Exe/App.hex
|
||||
GD32F103C8T6/App/Output/Debug/Exe/App.ind
|
||||
GD32F103C8T6/App/Output/Debug/Exe/App.map
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/ak517.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/ak517.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/api.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/api.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/app.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/app.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/can_parsing.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/can_parsing.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/can.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/can.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/delay.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/delay.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/diaodu.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/diaodu.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/fmc.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/fmc.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_adc.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_adc.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_bkp.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_bkp.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_can.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_can.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_crc.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_crc.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_dac.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_dac.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_dbg.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_dbg.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_dma.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_dma.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_enet.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_enet.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_exmc.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_exmc.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_exti.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_exti.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_fmc.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_fmc.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_fwdgt.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_fwdgt.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_gpio.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_gpio.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_i2c.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_i2c.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_md_Vectors.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_md_Vectors.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_misc.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_misc.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_pmu.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_pmu.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_rcu.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_rcu.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_rtc.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_rtc.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_sdio.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_sdio.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_spi.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_spi.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/GD32F10x_Startup.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/GD32F10x_Startup.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_timer.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_timer.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_usart.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_usart.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_wwdgt.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gd32f10x_wwdgt.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gpio.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/gpio.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/iap.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/iap.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/iic.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/iic.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/ir.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/ir.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/m62429.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/m62429.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/main.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/main.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/qgel50x.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/qgel50x.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/SEGGER_THUMB_Startup.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/SEGGER_THUMB_Startup.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/setting.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/setting.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/spi.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/spi.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/system_gd32f10x.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/system_gd32f10x.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/system.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/system.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/task.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/task.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/timer.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/timer.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/usart.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/usart.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/v58.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/v58.o
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/wdgt.d
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/wdgt.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Exe/Bootloader.elf
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Exe/Bootloader.hex
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Exe/Bootloader.ind
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Exe/Bootloader.map
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/delay.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/delay.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_adc.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_adc.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_bkp.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_bkp.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_can.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_can.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_crc.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_crc.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_dac.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_dac.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_dbg.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_dbg.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_dma.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_dma.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_enet.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_enet.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_exmc.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_exmc.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_exti.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_exti.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_fmc.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_fmc.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_fwdgt.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_fwdgt.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_gpio.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_gpio.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_i2c.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_i2c.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_md_Vectors.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_md_Vectors.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_misc.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_misc.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_pmu.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_pmu.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_rcu.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_rcu.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_rtc.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_rtc.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_sdio.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_sdio.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_spi.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_spi.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/GD32F10x_Startup.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/GD32F10x_Startup.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_timer.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_timer.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_usart.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_usart.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_wwdgt.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gd32f10x_wwdgt.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/main.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/main.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/SEGGER_THUMB_Startup.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/SEGGER_THUMB_Startup.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/system_gd32f10x.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/system_gd32f10x.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/task.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/task.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/timer.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/timer.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/usart.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/usart.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/wdgt.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/wdgt.o
|
||||
GD32F103C8T6/Bootloader/Bootloader_Debug.jlink
|
||||
GD32F103C8T6/App/App_Debug.jlink
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/fmc.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/fmc.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gpio.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/gpio.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/iap.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/iap.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/setting.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/setting.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/spi.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/spi.o
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/system.d
|
||||
GD32F103C8T6/Bootloader/Output/Debug/Obj/Bootloader/system.o
|
||||
GD32F103C8T6/GD32F10x.emSession
|
||||
WpfApp1/.vs/*
|
||||
WpfApp1/WpfApp1/obj/*
|
||||
WpfApp1/WpfApp1/bin/*
|
||||
GD32F103C8T6/App/Output/*
|
||||
GD32F103C8T6/Bootloader/Output/*
|
||||
GD32F103C8T6/._GD32F10x.emProject
|
||||
GD32F103C8T6/App/Output/Debug/Obj/App/v58-e8e109c7.o.tmp
|
||||
WpfApp1/.vs/WpfApp1/FileContentIndex/294201ea-13b4-4ce6-87c7-fe11eac372a1.vsidx
|
||||
协议文档/~$通信协议说明.docx
|
||||
*.emSession
|
||||
*.jlink
|
||||
._*
|
|
@ -23,6 +23,7 @@ static uint16_t upgrade_write_index = 0;
|
|||
/* 升级包数据接收长度 */
|
||||
static uint8_t upgrade_rx_buffer[1024] = {0};
|
||||
|
||||
static void api_write_upgrade_buffer(void);
|
||||
static void api_notify_upgrade(uint8_t *buffer, uint16_t length);
|
||||
static void api_notify_get_fhss_channel(void);
|
||||
static void api_package(uint8_t type, uint8_t command, uint8_t *data, uint8_t length);
|
||||
|
@ -199,6 +200,16 @@ void api_upload_data_forwarding(uint8_t type, uint8_t value)
|
|||
|
||||
__weak void api_notify_data_forwarding(uint8_t type, uint8_t value) { }
|
||||
|
||||
static void api_write_upgrade_buffer(void)
|
||||
{
|
||||
/* 写入升级包数据 */
|
||||
fmc_write_bytes(FMC_ADDRESS_UPGRADE_BUFFER + upgrade_write_index * FMC_PAGE_SIZE, upgrade_rx_buffer, upgrade_rx_index / 4 + (upgrade_rx_index % 4 ? 1 : 0));
|
||||
|
||||
upgrade_write_index++;
|
||||
upgrade_rx_length += upgrade_rx_index;
|
||||
upgrade_rx_index = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 升级
|
||||
*/
|
||||
|
@ -226,23 +237,21 @@ static void api_notify_upgrade(uint8_t *buffer, uint16_t length)
|
|||
upgrade_pack_index = 0;
|
||||
}
|
||||
|
||||
for (uint16_t i = 0; i < pack_length; i++)
|
||||
upgrade_rx_buffer[upgrade_rx_index++] = buffer[i + 9];
|
||||
|
||||
if (index == upgrade_pack_index + 1)
|
||||
{
|
||||
/* 更改ARM接收到的升级包序号 */
|
||||
upgrade_pack_index = index;
|
||||
|
||||
if (upgrade_rx_index >= 1024 || upgrade_pack_index == upgrade_pack_count)
|
||||
for (uint16_t i = 0; i < pack_length; i++)
|
||||
{
|
||||
/* 写入升级包数据 */
|
||||
fmc_write_bytes(FMC_ADDRESS_UPGRADE_BUFFER + upgrade_write_index * FMC_PAGE_SIZE, upgrade_rx_buffer, upgrade_rx_index / 4 + (upgrade_rx_index % 4 ? 1 : 0));
|
||||
upgrade_rx_buffer[upgrade_rx_index++] = buffer[i + 9];
|
||||
|
||||
upgrade_write_index++;
|
||||
upgrade_rx_length += upgrade_rx_index;
|
||||
upgrade_rx_index = 0;
|
||||
if (upgrade_rx_index >= 1024)
|
||||
api_write_upgrade_buffer();
|
||||
}
|
||||
|
||||
if (upgrade_pack_index == upgrade_pack_count)
|
||||
api_write_upgrade_buffer();
|
||||
|
||||
/* 通知上位机当前升级包成功接收 */
|
||||
api_response_success(API_COMMAND_UPGRADE);
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#define API_FRAME_RESPONSE (0x01) /* 响应帧 */
|
||||
#define API_FRAME_NOTIFICATION (0x02) /* 通知帧 */
|
||||
|
||||
#define SOFTWARE_VERSION ("V1.23")
|
||||
#define SOFTWARE_VERSION ("V1.28")
|
||||
#define HARDWARE_VERSION ("V1.01")
|
||||
|
||||
extern uint8_t api_upgrade_mode;
|
||||
|
|
|
@ -85,6 +85,8 @@ void v58_volume_down(void)
|
|||
*/
|
||||
void v58_stop(void)
|
||||
{
|
||||
delay_ms(100);
|
||||
|
||||
/* 停止 */
|
||||
v58_send_pulse(1);
|
||||
|
||||
|
|
|
@ -2,19 +2,20 @@
|
|||
|
||||
#include "can_parsing.h"
|
||||
|
||||
#define STROBE_LIGHT_MODE_SETTING_INDEX (0x00)
|
||||
#define CAN_TYPE_SETTING_INDEX (0x01)
|
||||
#define STROBE_LIGHT_ENABLE_SETTING_INDEX (0x02)
|
||||
#define VOLUME_LEVEL_SETTING_INDEX (0x03)
|
||||
#define STROBE_LIGHT_MODE_SETTING_INDEX (0x00)
|
||||
#define CAN_TYPE_SETTING_INDEX (0x01)
|
||||
#define STROBE_LIGHT_ENABLE_SETTING_INDEX (0x02)
|
||||
#define VOLUME_LEVEL_SETTING_INDEX (0x03)
|
||||
|
||||
static uint64_t can_rx_led_timestamp = 0;
|
||||
static uint64_t diaodu_rx_led_timestamp = 0;
|
||||
static uint64_t run_led_timestamp = 0;
|
||||
static uint64_t diaodu_status_rx_timestamp = 0;
|
||||
|
||||
static uint8_t vehicle_status_trigger_mode = 0; /* 车辆状态触发方式:0 IO; 1 CAN */
|
||||
static uint8_t door_front_status = 1, door_front_status_temporary = 1;
|
||||
static uint8_t door_back_status = 1, door_back_status_temporary = 1;
|
||||
static uint8_t door_status = 1, door_status_temporary = 2;
|
||||
static uint8_t door_status = 2, door_status_temporary = 2;
|
||||
static uint8_t turn_left_status = 1, turn_left_status_temporary = 1;
|
||||
static uint8_t turn_left_parsing_count = 0; /* 转向接收次数 */
|
||||
static uint8_t turn_right_status = 1, turn_right_status_temporary = 1;
|
||||
|
@ -51,6 +52,8 @@ static uint8_t diaodu_upload_status = 0;
|
|||
static void strobe_light_reset(void);
|
||||
/* 频闪灯闪烁*/
|
||||
static void strobe_light_toggle(uint8_t count);
|
||||
/* 投影灯控制 */
|
||||
static void lp_light_write(uint8_t status);
|
||||
|
||||
/* 设置音量级别 */
|
||||
static void set_volume_level(uint8_t level);
|
||||
|
@ -88,28 +91,33 @@ void gpio_interrupt_callback(uint32_t pin)
|
|||
switch (pin)
|
||||
{
|
||||
case DOOR_FRONT_PIN:
|
||||
door_front_status_temporary = gpio_input_bit_get(DOOR_FRONT_PERIPH, DOOR_FRONT_PIN);
|
||||
door_front_upload_status = 0x01;
|
||||
vehicle_status_trigger_mode = 0;
|
||||
door_front_status_temporary = gpio_input_bit_get(DOOR_FRONT_PERIPH, DOOR_FRONT_PIN);
|
||||
break;
|
||||
|
||||
case DOOR_BACK_PIN:
|
||||
door_back_status_temporary = gpio_input_bit_get(DOOR_BACK_PERIPH, DOOR_BACK_PIN);
|
||||
door_back_upload_status = 0x01;
|
||||
vehicle_status_trigger_mode = 0;
|
||||
door_back_status_temporary = gpio_input_bit_get(DOOR_BACK_PERIPH, DOOR_BACK_PIN);
|
||||
break;
|
||||
|
||||
case TURN_LEFT_PIN:
|
||||
turn_left_status_temporary = gpio_input_bit_get(TURN_LEFT_PERIPH, TURN_LEFT_PIN);
|
||||
turn_left_upload_status = 0x01;
|
||||
vehicle_status_trigger_mode = 0;
|
||||
turn_left_status_temporary = gpio_input_bit_get(TURN_LEFT_PERIPH, TURN_LEFT_PIN);
|
||||
break;
|
||||
|
||||
case TURN_RIGHT_PIN:
|
||||
turn_right_status_temporary = gpio_input_bit_get(TURN_RIGHT_PERIPH, TURN_RIGHT_PIN);
|
||||
turn_right_upload_status = 0x01;
|
||||
vehicle_status_trigger_mode = 0;
|
||||
turn_right_status_temporary = gpio_input_bit_get(TURN_RIGHT_PERIPH, TURN_RIGHT_PIN);
|
||||
break;
|
||||
|
||||
case REVERSING_PIN:
|
||||
reversing_status_temporary = gpio_input_bit_get(REVERSING_PERIPH, REVERSING_PIN);
|
||||
reversing_upload_status = 0x01;
|
||||
vehicle_status_trigger_mode = 0;
|
||||
reversing_status_temporary = gpio_input_bit_get(REVERSING_PERIPH, REVERSING_PIN);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -194,11 +202,14 @@ void app_init(void)
|
|||
static void strobe_light_reset(void)
|
||||
{
|
||||
gpio_bit_write(LED_STROBE_PERIPH, LED_STROBE_PIN, RESET);
|
||||
|
||||
/* 恢复投影灯状态 */
|
||||
lp_light_write(0);
|
||||
}
|
||||
|
||||
static void strobe_light_toggle(uint8_t count)
|
||||
{
|
||||
while(count--)
|
||||
while (count--)
|
||||
{
|
||||
gpio_bit_write(LED_STROBE_PERIPH, LED_STROBE_PIN, SET);
|
||||
delay_ms(100);
|
||||
|
@ -207,6 +218,14 @@ static void strobe_light_toggle(uint8_t count)
|
|||
}
|
||||
}
|
||||
|
||||
static void lp_light_write(uint8_t status)
|
||||
{
|
||||
/* 激光投影设备 */
|
||||
gpio_bit_write(LP_FRONT_DOOR_PERIPH, LP_FRONT_DOOR_PIN, (bit_status)status);
|
||||
gpio_bit_write(LP_BACK_DOOR_PERIPH, LP_BACK_DOOR_PIN, (bit_status)status);
|
||||
gpio_bit_write(LP_CAR_REAR_PERIPH, LP_CAR_REAR_PIN, (bit_status)status);
|
||||
}
|
||||
|
||||
static void led_parsing_task(uint8_t uuid)
|
||||
{
|
||||
/* 超过 2s 未检测到CAN数据变化,熄灭发送指示灯 */
|
||||
|
@ -348,22 +367,26 @@ static void can_parsing_task(uint8_t uuid)
|
|||
{
|
||||
can_channge_status = 1;
|
||||
door_front_upload_status = 0x01;
|
||||
vehicle_status_trigger_mode = 1;
|
||||
}
|
||||
|
||||
if (door_back_status_temporary != door_back_status)
|
||||
{
|
||||
can_channge_status = 1;
|
||||
door_back_upload_status = 0x01;
|
||||
vehicle_status_trigger_mode = 1;
|
||||
}
|
||||
|
||||
if (turn_left_status_temporary != turn_left_status)
|
||||
{
|
||||
can_channge_status = 1;
|
||||
turn_left_upload_status = 0x01;
|
||||
vehicle_status_trigger_mode = 1;
|
||||
}
|
||||
|
||||
if (turn_right_status_temporary != turn_right_status)
|
||||
{
|
||||
vehicle_status_trigger_mode = 1;
|
||||
can_channge_status = 1;
|
||||
turn_right_upload_status = 0x01;
|
||||
}
|
||||
|
@ -372,9 +395,10 @@ static void can_parsing_task(uint8_t uuid)
|
|||
{
|
||||
can_channge_status = 1;
|
||||
reversing_upload_status = 0x01;
|
||||
vehicle_status_trigger_mode = 1;
|
||||
}
|
||||
|
||||
if(can_channge_status == 1)
|
||||
if (can_channge_status == 1)
|
||||
{
|
||||
gpio_bit_write(LED_CAN_PERIPH, LED_CAN_PIN, SET);
|
||||
can_rx_led_timestamp = timestamp;
|
||||
|
@ -396,6 +420,9 @@ static void strobe_light_operate_task(uint8_t uuid)
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
lp_light_write(1);
|
||||
|
||||
strobe_light_flashing_count += 1;
|
||||
|
||||
if (strobe_light_flashing_mode == 0)
|
||||
|
@ -413,8 +440,6 @@ static void strobe_light_operate_task(uint8_t uuid)
|
|||
{
|
||||
/* 频闪 */
|
||||
gpio_bit_write(LED_STROBE_PERIPH, LED_STROBE_PIN, !(strobe_light_flashing_count % 2));
|
||||
|
||||
//gpio_bit_toggle(LED_STROBE_PERIPH, LED_STROBE_PIN);
|
||||
|
||||
if (strobe_light_flashing_count >= 4)
|
||||
{
|
||||
|
@ -430,7 +455,7 @@ static void strobe_light_operate_task(uint8_t uuid)
|
|||
{
|
||||
/* 爆闪 */
|
||||
gpio_bit_write(LED_STROBE_PERIPH, LED_STROBE_PIN, !(strobe_light_flashing_count % 2));
|
||||
//gpio_bit_toggle(LED_STROBE_PERIPH, LED_STROBE_PIN);
|
||||
// gpio_bit_toggle(LED_STROBE_PERIPH, LED_STROBE_PIN);
|
||||
|
||||
if (strobe_light_flashing_count >= 20)
|
||||
{
|
||||
|
@ -466,6 +491,10 @@ static void vehicle_status_parsing_task(uint8_t uuid)
|
|||
|
||||
uint8_t door_change = 0;
|
||||
|
||||
/* IO状态下必须保持是实时状态 */
|
||||
if (vehicle_status_trigger_mode == 0)
|
||||
reversing_status_temporary = gpio_input_bit_get(REVERSING_PERIPH, REVERSING_PIN);
|
||||
|
||||
/* 倒车状态判断 */
|
||||
if (reversing_status != reversing_status_temporary)
|
||||
{
|
||||
|
@ -477,8 +506,16 @@ static void vehicle_status_parsing_task(uint8_t uuid)
|
|||
|
||||
/* 优先级最高, 如果状态为触发, 关闭语音 */
|
||||
if (reversing_status == 0)
|
||||
{
|
||||
v58_stop();
|
||||
|
||||
/* 修改系统当前状态 */
|
||||
diaodu_status = 0xFF;
|
||||
door_status = 0x01;
|
||||
turn_left_status = 0x01;
|
||||
turn_right_status = 0x01;
|
||||
}
|
||||
|
||||
goto EXECUTE;
|
||||
}
|
||||
|
||||
|
@ -486,54 +523,20 @@ static void vehicle_status_parsing_task(uint8_t uuid)
|
|||
if (reversing_status == 0)
|
||||
return;
|
||||
|
||||
/* 进出站状态判断 */
|
||||
if (diaodu_status_temporry != 0 && diaodu_status != diaodu_status_temporry)
|
||||
/* IO状态下必须保持是实时状态 */
|
||||
if (vehicle_status_trigger_mode == 0)
|
||||
{
|
||||
/* 当前为出站状态, 如果之前是进站状态,则停止播报, 否则不处理 */
|
||||
if(diaodu_status_temporry == 2)
|
||||
{
|
||||
if(diaodu_status == 1)
|
||||
{
|
||||
status = 0x00;
|
||||
status_type = 5;
|
||||
}
|
||||
}
|
||||
/* 到站 */
|
||||
else if (diaodu_status_temporry == 1)
|
||||
{
|
||||
status = 0x01;
|
||||
status_type = 4;
|
||||
|
||||
/* 优先级最高,关闭语音 */
|
||||
v58_stop();
|
||||
}
|
||||
|
||||
diaodu_status = diaodu_status_temporry;
|
||||
|
||||
goto EXECUTE;
|
||||
door_front_status_temporary = gpio_input_bit_get(DOOR_FRONT_PERIPH, DOOR_FRONT_PIN);
|
||||
door_back_status_temporary = gpio_input_bit_get(DOOR_BACK_PERIPH, DOOR_BACK_PIN);
|
||||
}
|
||||
|
||||
/* 如果一直处于进站状态, 超过 2 分钟, 则取消该状态, 并停止语音 */
|
||||
if (diaodu_status == 1)
|
||||
{
|
||||
if(diaodu_status_rx_timestamp != 0 &&
|
||||
timestamp - diaodu_status_rx_timestamp >= 120000)
|
||||
{
|
||||
/* 修改为出站状态 */
|
||||
diaodu_arrival_or_departure_parsing(0x02);
|
||||
|
||||
goto EXECUTE;
|
||||
}
|
||||
}
|
||||
|
||||
if (door_front_status_temporary != door_front_status)
|
||||
if (door_front_status != door_front_status_temporary)
|
||||
door_front_status = door_front_status_temporary;
|
||||
|
||||
if (door_back_status_temporary != door_back_status)
|
||||
if (door_back_status != door_back_status_temporary)
|
||||
door_back_status = door_back_status_temporary;
|
||||
|
||||
//door_status_temporary = door_front_status_temporary + door_back_status_temporary;
|
||||
door_status_temporary = door_front_status_temporary | door_back_status_temporary;
|
||||
door_status_temporary = door_front_status_temporary & door_back_status_temporary;
|
||||
|
||||
if (door_status != door_status_temporary)
|
||||
{
|
||||
|
@ -544,8 +547,8 @@ static void vehicle_status_parsing_task(uint8_t uuid)
|
|||
status_type = 0;
|
||||
}
|
||||
|
||||
/* 当前后门开启后 */
|
||||
if(door_status == 0)
|
||||
/* 当前、后门开启后 */
|
||||
if (door_status == 0)
|
||||
{
|
||||
/* 进站状态, 不继续执行 */
|
||||
if (diaodu_status == 1)
|
||||
|
@ -557,20 +560,85 @@ static void vehicle_status_parsing_task(uint8_t uuid)
|
|||
diaodu_status_temporry = diaodu_status = 0;
|
||||
}
|
||||
|
||||
turn_left_status = 0x01;
|
||||
turn_right_status = 0x01;
|
||||
|
||||
/* 不处理其他数据 */
|
||||
goto EXECUTE;
|
||||
}
|
||||
|
||||
/* 当前、后车门状态关闭, 才进行调度处理 */
|
||||
if (door_status == 1)
|
||||
{
|
||||
/* 进出站状态判断 */
|
||||
if (diaodu_status_temporry != 0 && diaodu_status != diaodu_status_temporry)
|
||||
{
|
||||
/* 当前为出站状态, 如果之前是进站状态,则停止播报, 否则不处理 */
|
||||
if (diaodu_status_temporry == 2)
|
||||
{
|
||||
if (diaodu_status == 1)
|
||||
{
|
||||
status = 0x00;
|
||||
status_type = 5;
|
||||
|
||||
door_status = 0x01;
|
||||
turn_left_status = 0x01;
|
||||
turn_right_status = 0x01;
|
||||
|
||||
diaodu_status = diaodu_status_temporry;
|
||||
|
||||
goto EXECUTE;
|
||||
}
|
||||
|
||||
diaodu_status = diaodu_status_temporry;
|
||||
|
||||
return;
|
||||
}
|
||||
/* 到站 */
|
||||
else if (diaodu_status_temporry == 1)
|
||||
{
|
||||
status = 0x01;
|
||||
status_type = 4;
|
||||
|
||||
/* 优先级最高,关闭语音 */
|
||||
v58_stop();
|
||||
|
||||
door_status = 0x01;
|
||||
turn_left_status = 0x01;
|
||||
turn_right_status = 0x01;
|
||||
|
||||
diaodu_status = diaodu_status_temporry;
|
||||
|
||||
goto EXECUTE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 如果一直处于进站状态, 超过 2 分钟, 则取消该状态, 并停止语音 */
|
||||
if (diaodu_status == 1)
|
||||
{
|
||||
/* 修改为出站状态 */
|
||||
if (diaodu_status_rx_timestamp != 0 &&
|
||||
timestamp - diaodu_status_rx_timestamp >= 120000)
|
||||
diaodu_arrival_or_departure_parsing(0x02);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* 左转弯状态判断 */
|
||||
if (turn_left_status != turn_left_status_temporary)
|
||||
{
|
||||
/* 如果未触发状态, 需进行二次判断 */
|
||||
if (turn_left_status_temporary == 1)
|
||||
/* 只有通过IO接收的数据,才需要做脉冲判断 */
|
||||
if (vehicle_status_trigger_mode == 0)
|
||||
{
|
||||
turn_left_parsing_count++;
|
||||
/* 如果未触发状态, 需进行二次判断 */
|
||||
if (turn_left_status_temporary == 1)
|
||||
{
|
||||
turn_left_parsing_count++;
|
||||
|
||||
if (turn_left_parsing_count < 3)
|
||||
goto TURN_RIGHT_STATUS_TAG2;
|
||||
if (turn_left_parsing_count < 3)
|
||||
goto TURN_RIGHT_STATUS_TAG2;
|
||||
}
|
||||
}
|
||||
|
||||
turn_left_parsing_count = 0;
|
||||
|
@ -586,7 +654,7 @@ static void vehicle_status_parsing_task(uint8_t uuid)
|
|||
|
||||
status_type = 1;
|
||||
|
||||
//printf("left status = %d \r\n", status);
|
||||
// printf("left status = %d \r\n", status);
|
||||
|
||||
goto EXECUTE;
|
||||
}
|
||||
|
@ -596,13 +664,17 @@ TURN_RIGHT_STATUS_TAG2:
|
|||
/* 右转弯状态判断 */
|
||||
if (turn_right_status != turn_right_status_temporary)
|
||||
{
|
||||
/* 如果未触发状态, 需进行二次判断 */
|
||||
if (turn_right_status_temporary == 1)
|
||||
/* 只有通过IO接收的数据,才需要做脉冲判断 */
|
||||
if (vehicle_status_trigger_mode == 0)
|
||||
{
|
||||
turn_right_parsing_count++;
|
||||
/* 如果未触发状态, 需进行二次判断 */
|
||||
if (turn_right_status_temporary == 1)
|
||||
{
|
||||
turn_right_parsing_count++;
|
||||
|
||||
if (turn_right_parsing_count < 3)
|
||||
goto EXECUTE;
|
||||
if (turn_right_parsing_count < 3)
|
||||
goto EXECUTE;
|
||||
}
|
||||
}
|
||||
|
||||
turn_right_parsing_count = 0;
|
||||
|
@ -613,12 +685,12 @@ TURN_RIGHT_STATUS_TAG2:
|
|||
else
|
||||
{
|
||||
turn_right_status = turn_right_status_temporary;
|
||||
|
||||
|
||||
status = turn_right_status == 0 ? 1 : 0;
|
||||
|
||||
status_type = 2;
|
||||
|
||||
//printf("right status = %d \r\n", status);
|
||||
// printf("right status = %d \r\n", status);
|
||||
|
||||
goto EXECUTE;
|
||||
}
|
||||
|
@ -631,7 +703,7 @@ TURN_RIGHT_STATUS_TAG2:
|
|||
if (emergency_flashers_status != emergency_flashers_status_temporary)
|
||||
{
|
||||
emergency_flashers_status = emergency_flashers_status_temporary;
|
||||
|
||||
|
||||
if (emergency_flashers_status_temporary == 0)
|
||||
{
|
||||
/* 挂起 频闪灯控制任务 */
|
||||
|
@ -647,9 +719,9 @@ TURN_RIGHT_STATUS_TAG2:
|
|||
task_resume(emergency_flashers_operate_task_uuid);
|
||||
|
||||
#if defined(USE_AK517)
|
||||
ak517_please_note_that();
|
||||
ak517_please_note_that();
|
||||
#elif defined(USE_QGEL50X)
|
||||
qgel50x_please_note_that();
|
||||
qgel50x_please_note_that();
|
||||
#endif
|
||||
}
|
||||
else if (emergency_flashers_status_temporary == 1)
|
||||
|
@ -792,26 +864,6 @@ void diaodu_arrival_or_departure_parsing(uint8_t status)
|
|||
gpio_bit_write(LED_DIAODU_PERIPH, LED_DIAODU_PIN, SET);
|
||||
}
|
||||
|
||||
//void ir_key_triggered(uint8_t key)
|
||||
//{
|
||||
// uint8_t level = 0x00;
|
||||
|
||||
// if (key == 0x98) /* + */
|
||||
// level = volume_level - 1;
|
||||
// else if (key == 0x68) /* - */
|
||||
// level = volume_level + 1;
|
||||
// else if(key == 0xA2)
|
||||
// level = 3;
|
||||
// else
|
||||
// return;
|
||||
|
||||
// strobe_light_toggle(2);
|
||||
|
||||
// set_volume_level(level);
|
||||
|
||||
// api_upload_data_forwarding(0x06, level);
|
||||
//}
|
||||
|
||||
void api_notify_data_upload(uint8_t *buffer, uint16_t length)
|
||||
{
|
||||
led_tx_update();
|
||||
|
@ -912,8 +964,7 @@ void api_notify_data_forwarding(uint8_t type, uint8_t value)
|
|||
break;
|
||||
|
||||
case 0x05:
|
||||
diaodu_upload_status = 0x01;
|
||||
diaodu_status_temporry = value;
|
||||
diaodu_arrival_or_departure_parsing(value);
|
||||
break;
|
||||
|
||||
case 0x06:
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#include "main.h"
|
||||
|
||||
static uint32_t can_filter_id[9] = {0x18FED925, 0x18F00503, 0x18FDA589, 0x18FE419B, 0x18F00503, 0x18A70017, 0x18F40117, 0x18F101D0, 0x18FFD117};
|
||||
|
||||
static void bsp_initialization(void);
|
||||
|
||||
int main(void)
|
||||
|
@ -26,6 +28,9 @@ static void bsp_initialization(void)
|
|||
/* CAN0 初始化, 波特率250 */
|
||||
can_config(CAN0, 250);
|
||||
|
||||
/* CAN0 设置过滤 (允许列表ID通过) */
|
||||
can_set_filter_by_id(CAN0, can_filter_id, 9);
|
||||
|
||||
/* 上位机 通讯串口 初始化 */
|
||||
usart_config(HOST_USART_PERIPH, 115200, USART_PM_NONE);
|
||||
|
||||
|
@ -44,21 +49,13 @@ static void bsp_initialization(void)
|
|||
gpio_config(VOLUME_3_PERIPH, VOLUME_3_PIN, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, nullptr);
|
||||
gpio_config(VOLUME_4_PERIPH, VOLUME_4_PIN, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, nullptr);
|
||||
|
||||
/* 前门 检测引脚 初始化 */
|
||||
/* 前门 后门 左转弯 右转弯 倒车 检测引脚 初始化 */
|
||||
gpio_interrupt_config(DOOR_FRONT_PERIPH, DOOR_FRONT_PIN, EXTI_TRIG_BOTH);
|
||||
|
||||
/* 后门 检测引脚 初始化 */
|
||||
gpio_interrupt_config(DOOR_BACK_PERIPH, DOOR_BACK_PIN, EXTI_TRIG_BOTH);
|
||||
|
||||
/* 左转弯 检测引脚 初始化 */
|
||||
gpio_interrupt_config(TURN_LEFT_PERIPH, TURN_LEFT_PIN, EXTI_TRIG_BOTH);
|
||||
|
||||
/* 右转弯 检测引脚 初始化 */
|
||||
gpio_interrupt_config(TURN_RIGHT_PERIPH, TURN_RIGHT_PIN, EXTI_TRIG_BOTH);
|
||||
|
||||
/* 倒车 检测引脚 初始化 */
|
||||
gpio_interrupt_config(REVERSING_PERIPH, REVERSING_PIN, EXTI_TRIG_BOTH);
|
||||
|
||||
|
||||
/* 功放控制脚,默认开启 */
|
||||
gpio_config(AMP_CTRL_PERIPH, AMP_CTRL_PIN, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, SET);
|
||||
|
||||
|
@ -69,7 +66,13 @@ static void bsp_initialization(void)
|
|||
gpio_config(V58_STATUS_PERIPH, V58_STATUS_PIN, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, nullptr);
|
||||
|
||||
iic_config(M62429_SDA_PERIPH, M62429_SDA_PIN, M62429_SCL_PERIPH, M62429_SCL_PIN);
|
||||
|
||||
|
||||
/* 激光投影设备 控制引脚 初始化 */
|
||||
gpio_config(LP_FRONT_DOOR_PERIPH, LP_FRONT_DOOR_PIN, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, RESET);
|
||||
gpio_config(LP_BACK_DOOR_PERIPH, LP_BACK_DOOR_PIN, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, RESET);
|
||||
gpio_config(LP_CAR_REAR_PERIPH, LP_CAR_REAR_PIN, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, RESET);
|
||||
|
||||
|
||||
/* CAN指示灯 控制引脚 初始化 */
|
||||
gpio_config(LED_CAN_PERIPH, LED_CAN_PIN, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, RESET);
|
||||
|
||||
|
|
|
@ -104,6 +104,18 @@
|
|||
#define M62429_SDA_PERIPH GPIOB
|
||||
#define M62429_SDA_PIN GPIO_PIN_11
|
||||
|
||||
/* 激光投影设备(前门) */
|
||||
#define LP_FRONT_DOOR_PERIPH GPIOC
|
||||
#define LP_FRONT_DOOR_PIN GPIO_PIN_13
|
||||
|
||||
/* 激光投影设备(后门) */
|
||||
#define LP_BACK_DOOR_PERIPH GPIOC
|
||||
#define LP_BACK_DOOR_PIN GPIO_PIN_14
|
||||
|
||||
/* 激光投影设备(车尾) */
|
||||
#define LP_CAR_REAR_PERIPH GPIOC
|
||||
#define LP_CAR_REAR_PIN GPIO_PIN_15
|
||||
|
||||
#define LED_CAN_PERIPH GPIOA
|
||||
#define LED_CAN_PIN GPIO_PIN_5
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user