form->from

This commit is contained in:
RB 2025-03-11 16:17:10 +08:00
parent 4cc319e997
commit cff20de568
9 changed files with 26 additions and 61 deletions

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -37,43 +37,8 @@ Note: source file '..\User\task\ai.c' - object file renamed from 'DevC\ai.o' to
Note: source file '..\User\task\can.c' - object file renamed from 'DevC\can.o' to 'DevC\can_3.o'.
Note: source file '..\User\task\cap.c' - object file renamed from 'DevC\cap.o' to 'DevC\cap_1.o'.
Note: source file '..\User\task\referee.c' - object file renamed from 'DevC\referee.o' to 'DevC\referee_1.o'.
compiling ballistics.c...
compiling ahrs.c...
compiling freertos.c...
compiling capacity.c...
compiling cmd.c...
compiling crc16.c...
compiling filter.c...
compiling mixer.c...
compiling pid.c...
compiling user_math.c...
compiling ui.c...
compiling bmi088.c...
compiling can.c...
compiling dr16.c...
compiling ist8310.c...
compiling ai.c...
compiling referee.c...
compiling cap.c...
compiling config.c...
compiling gimbal.c...
compiling chassis.c...
compiling shoot.c...
compiling ai.c...
compiling atti_esti.c...
compiling cap.c...
compiling can.c...
compiling cli.c...
compiling command.c...
compiling ctrl_chassis.c...
compiling ctrl_gimbal.c...
compiling ctrl_shoot.c...
compiling info.c...
compiling init.c...
compiling monitor.c...
compiling rc.c...
compiling referee.c...
compiling user_task.c...
linking...
Program Size: Code=148832 RO-data=6908 RW-data=760 ZI-data=43832
FromELF: creating hex file...
@ -91,7 +56,7 @@ Package Vendor: Keil
C:\Users\lvzucheng\AppData\Local\Arm\Packs\Keil\STM32F4xx_DFP\2.15.0\Drivers\CMSIS\Device\ST\STM32F4xx\Include
<h2>Collection of Component Files used:</h2>
Build Time Elapsed: 00:00:11
Build Time Elapsed: 00:00:03
</pre>
</body>
</html>

View File

@ -3,7 +3,7 @@
<title>Static Call Graph - [DevC\DevC.axf]</title></head>
<body><HR>
<H1>Static Call Graph for image DevC\DevC.axf</H1><HR>
<BR><P>#&#060CALLGRAPH&#062# ARM Linker, 6160001: Last Updated: Tue Mar 11 09:18:01 2025
<BR><P>#&#060CALLGRAPH&#062# ARM Linker, 6160001: Last Updated: Tue Mar 11 09:24:59 2025
<BR><P>
<H3>Maximum Stack Usage = 632 bytes + Unknown(Cycles, Untraceable Function Pointers)</H3><H3>
Call chain for Maximum Stack Depth:</H3>

View File

@ -4251,8 +4251,8 @@ I (..\User\bsp\uart.h)(0x6070F48E)
I (..\Core\Inc\usart.h)(0x6070F48E)
I (..\User\component\crc16.h)(0x6070F48E)
I (..\User\component\crc8.h)(0x6070F48E)
F (..\User\device\ai.c)(0x67CF8F2C)(-xc -std=c11 --target=arm-arm-none-eabi -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -c -fno-rtti -funsigned-char -fshort-enums -fshort-wchar -D__MICROLIB -gdwarf-3 -O0 -ffunction-sections -I ../Core/Inc -I ../USB_DEVICE/App -I ../USB_DEVICE/Target -I ../Drivers/STM32F4xx_HAL_Driver/Inc -I ../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -I ../Middlewares/Third_Party/FreeRTOS/Source/include -I ../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM4F -I ../Middlewares/ST/STM32_USB_Device_Library/Core/Inc -I ../Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc -I ../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I ../Drivers/CMSIS/Include -I ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 -I ../Drivers/CMSIS/DSP/Include -I ../User -I ../Middlewares/Third_Party/Protocol -Wall -Wextra -I./RTE/_Debug -IC:/Users/lvzucheng/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.15.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include -D__UVISION_VERSION="534" -D_RTE_ -DSTM32F407xx -D_RTE_ -DUSE_HAL_DRIVER -DDEV_BOARD_C -DSTM32F407xx -DDEBUG -o devc/ai.o -MD)
I (..\User\device\ai.h)(0x67CF8D37)
F (..\User\device\ai.c)(0x67CF90A9)(-xc -std=c11 --target=arm-arm-none-eabi -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -c -fno-rtti -funsigned-char -fshort-enums -fshort-wchar -D__MICROLIB -gdwarf-3 -O0 -ffunction-sections -I ../Core/Inc -I ../USB_DEVICE/App -I ../USB_DEVICE/Target -I ../Drivers/STM32F4xx_HAL_Driver/Inc -I ../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -I ../Middlewares/Third_Party/FreeRTOS/Source/include -I ../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM4F -I ../Middlewares/ST/STM32_USB_Device_Library/Core/Inc -I ../Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc -I ../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I ../Drivers/CMSIS/Include -I ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 -I ../Drivers/CMSIS/DSP/Include -I ../User -I ../Middlewares/Third_Party/Protocol -Wall -Wextra -I./RTE/_Debug -IC:/Users/lvzucheng/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.15.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include -D__UVISION_VERSION="534" -D_RTE_ -DSTM32F407xx -D_RTE_ -DUSE_HAL_DRIVER -DDEV_BOARD_C -DSTM32F407xx -DDEBUG -o devc/ai.o -MD)
I (..\User\device\ai.h)(0x67CF90AE)
I (..\Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS_V2\cmsis_os2.h)(0x6070F48E)
I (C:\Keil_v5\ARM\ARMCLANG\include\stdint.h)(0x6035A4A8)
I (C:\Keil_v5\ARM\ARMCLANG\include\stddef.h)(0x6035A4A8)
@ -4651,7 +4651,7 @@ I (C:\Keil_v5\ARM\ARMCLANG\include\string.h)(0x6035A4A8)
I (..\User\bsp\pwm.h)(0x6070F48E)
I (..\User\component\limiter.h)(0x6070F48E)
F (..\User\task\ai.c)(0x67CF8D37)(-xc -std=c11 --target=arm-arm-none-eabi -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -c -fno-rtti -funsigned-char -fshort-enums -fshort-wchar -D__MICROLIB -gdwarf-3 -O0 -ffunction-sections -I ../Core/Inc -I ../USB_DEVICE/App -I ../USB_DEVICE/Target -I ../Drivers/STM32F4xx_HAL_Driver/Inc -I ../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -I ../Middlewares/Third_Party/FreeRTOS/Source/include -I ../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM4F -I ../Middlewares/ST/STM32_USB_Device_Library/Core/Inc -I ../Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc -I ../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I ../Drivers/CMSIS/Include -I ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 -I ../Drivers/CMSIS/DSP/Include -I ../User -I ../Middlewares/Third_Party/Protocol -Wall -Wextra -I./RTE/_Debug -IC:/Users/lvzucheng/AppData/Local/Arm/Packs/Keil/STM32F4xx_DFP/2.15.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include -D__UVISION_VERSION="534" -D_RTE_ -DSTM32F407xx -D_RTE_ -DUSE_HAL_DRIVER -DDEV_BOARD_C -DSTM32F407xx -DDEBUG -o devc/ai_1.o -MD)
I (..\User\device\ai.h)(0x67CF8D37)
I (..\User\device\ai.h)(0x67CF90AE)
I (..\Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS_V2\cmsis_os2.h)(0x6070F48E)
I (C:\Keil_v5\ARM\ARMCLANG\include\stdint.h)(0x6035A4A8)
I (C:\Keil_v5\ARM\ARMCLANG\include\stddef.h)(0x6035A4A8)

Binary file not shown.

Binary file not shown.

View File

@ -75,10 +75,10 @@ bool AI_WaitDmaCplt(void) {
}
int8_t AI_ParseHost(AI_t *ai) {
if (!CRC16_Verify((const uint8_t *)&(rxbuf), sizeof(ai->form_host)))
if (!CRC16_Verify((const uint8_t *)&(rxbuf), sizeof(ai->from_host)))
goto error;
ai->ai_online = true;
memcpy(&(ai->form_host), rxbuf, sizeof(ai->form_host));
memcpy(&(ai->from_host), rxbuf, sizeof(ai->from_host));
memset(rxbuf, 0, AI_LEN_RX_BUFF);
return DEVICE_OK;
@ -88,20 +88,20 @@ error:
}
void AI_PackCmd(AI_t *ai, CMD_Host_t *cmd_host) {
cmd_host->gimbal_delta.yaw = ai->form_host.data.gimbal.yaw;
cmd_host->gimbal_delta.pit = ai->form_host.data.gimbal.pit;
cmd_host->fire = (ai->form_host.data.notice & AI_NOTICE_FIRE);
cmd_host->rotor = (ai->form_host.data.notice & AI_NOTICE_ROTOR);
cmd_host->chassis_move_vec.vx = ai->form_host.data.chassis_move_vec.vx;
cmd_host->chassis_move_vec.vy = ai->form_host.data.chassis_move_vec.vy;
cmd_host->chassis_move_vec.wz = ai->form_host.data.chassis_move_vec.wz;
cmd_host->gimbal_delta.yaw = ai->from_host.data.gimbal.yaw;
cmd_host->gimbal_delta.pit = ai->from_host.data.gimbal.pit;
cmd_host->fire = (ai->from_host.data.notice & AI_NOTICE_FIRE);
cmd_host->rotor = (ai->from_host.data.notice & AI_NOTICE_ROTOR);
cmd_host->chassis_move_vec.vx = ai->from_host.data.chassis_move_vec.vx;
cmd_host->chassis_move_vec.vy = ai->from_host.data.chassis_move_vec.vy;
cmd_host->chassis_move_vec.wz = ai->from_host.data.chassis_move_vec.wz;
}
int8_t AI_HandleOffline(AI_t *ai, CMD_Host_t *cmd_host) {
if (ai == NULL) return DEVICE_ERR_NULL;
if (cmd_host == NULL) return DEVICE_ERR_NULL;
ai->ai_online = false;
memset(&(ai->form_host), 0, sizeof(ai->form_host));
memset(&(ai->from_host), 0, sizeof(ai->from_host));
memset(cmd_host, 0, sizeof(*cmd_host));
return 0;
}

View File

@ -38,7 +38,7 @@ typedef struct __packed {
typedef struct __packed {
osThreadId_t thread_alert;
Protocol_DownPackage_t form_host;
Protocol_DownPackage_t from_host;
struct {
AI_UpPackageReferee_t ref;