Browse Source

【待优化】整体编译通过,但是目前关闭了Werror

master
Lizongdi 3 weeks ago
parent
commit
ba58a64177
  1. 6
      Bingoo/base/BHBF_ROBOT.c
  2. 2
      Bingoo/base/Handset_Status_Setting.c
  3. 6
      Bingoo/base/bsp_EEPROM.c
  4. 5
      Bingoo/base/bsp_GPIO.c
  5. 2
      Bingoo/base/bsp_INTERCALL.c
  6. 2
      Bingoo/base/bsp_MB_host.c
  7. 4
      Bingoo/base/bsp_TCPClient.c
  8. 4
      Bingoo/base/bsp_TIMER.c
  9. 2
      Bingoo/base/bsp_UART.c
  10. 7
      Bingoo/base/bsp_UDP.c
  11. 4
      Bingoo/base/bsp_client_setting.c
  12. 4
      Bingoo/base/bsp_com_helper.c
  13. 6
      Bingoo/base/bsp_cpu_flash.c
  14. 1
      Bingoo/base/bsp_decode_command.c
  15. 2
      Bingoo/base/bsp_tempature.c
  16. 5
      Bingoo/base/fsm_state_control.c
  17. 6
      Bingoo/base/msp_DAM_Relay.c
  18. 2
      Bingoo/base/msp_MK32_1.c
  19. 2
      Bingoo/base/msp_TL720D.c
  20. 2
      Bingoo/base/msp_TTMotor_ZQ.c
  21. 2
      Bingoo/base/msp_WH_LTE_7S0.c
  22. 25
      Bingoo/base/msp_ground_management.c
  23. 22
      Bingoo/base/msp_strain_gauge.c
  24. 9
      Bingoo/base/robot_move_actions.c
  25. 1
      Bingoo/base/swing_action.c
  26. 4
      Bingoo/base/tcp_server.c
  27. 42
      Bingoo/include/base/BHBF_ROBOT.h
  28. 2
      Bingoo/include/base/bsp_Error_Detect.h
  29. 2
      Bingoo/include/base/bsp_MB_host.h
  30. 1
      Bingoo/include/base/bsp_TCPClient.h
  31. 2
      Bingoo/include/base/bsp_TIMER.h
  32. 2
      Bingoo/include/base/bsp_UART.h
  33. 2
      Bingoo/include/base/bsp_UpperComputer_Handler.h
  34. 2
      Bingoo/include/base/bsp_mqtt_pub.h
  35. 2
      Bingoo/include/base/msp_JTBATTERY.h
  36. 2
      Bingoo/include/base/msp_MK32_1.h
  37. 2
      Bingoo/include/base/msp_TL720D.h
  38. 1
      Bingoo/library/CMakeLists.txt
  39. 1
      Bingoo/main/CMakeLists.txt
  40. 1
      Core/Src/main.c

6
Bingoo/base/BHBF_ROBOT.c

@ -4,7 +4,7 @@
* Created on: Oct 26, 2023 * Created on: Oct 26, 2023
* Author: shiya * Author: shiya
*/ */
#include "fsm.h" //#include "fsm.h"
#include "BHBF_ROBOT.h" #include "BHBF_ROBOT.h"
#include <string.h> #include <string.h>
@ -101,6 +101,8 @@ bool CompareTimer(int32_t DelayMiliSeconds,Sys_timer_handler * timer_handler)
} }
} }
#if 0
bool CompareTimer_Delay(int32_t Delay) bool CompareTimer_Delay(int32_t Delay)
{ {
@ -118,6 +120,8 @@ bool CompareTimer_Delay(int32_t Delay)
} }
} }
#endif
/*m/min--->0.1m/min 其实就是×10*/ /*m/min--->0.1m/min 其实就是×10*/
int32_t speed_M_min_toE01_M_min(int32_t speedm_min) int32_t speed_M_min_toE01_M_min(int32_t speedm_min)
{ {

2
Bingoo/base/Handset_Status_Setting.c

@ -178,7 +178,7 @@ static InputEvent CalculateRockerEvent(void)
{ {
int16_t vert = P_MK32->CH2_LY_V; int16_t vert = P_MK32->CH2_LY_V;
int16_t hori = P_MK32->CH3_LY_H; int16_t hori = P_MK32->CH3_LY_H;
int16_t swing = P_MK32->CH0_RY_H; //int16_t swing = P_MK32->CH0_RY_H;
// 摇杆中位判断 // 摇杆中位判断
if ((fabs(vert) < ROCKER_THRESHOLD_DEFAULT) && (fabs(hori) < ROCKER_THRESHOLD_DEFAULT)) if ((fabs(vert) < ROCKER_THRESHOLD_DEFAULT) && (fabs(hori) < ROCKER_THRESHOLD_DEFAULT))

6
Bingoo/base/bsp_EEPROM.c

@ -4,7 +4,7 @@
* Created on: Oct 26, 2023 * Created on: Oct 26, 2023
* Author: shiya * Author: shiya
*/ */
#include "BSP/bsp_EEPROM.h" #include "bsp_EEPROM.h"
void bsp_InitI2C(void); void bsp_InitI2C(void);
void i2c_Start(void); void i2c_Start(void);
@ -527,7 +527,7 @@ CV_struct_define GF_BSP_EEPROM_Get_CV(void)
{ {
CV_struct_define cv= {0}; CV_struct_define cv= {0};
//char buffer[sizeof(CV_struct_define)]; //char buffer[sizeof(CV_struct_define)];
GF_BSP_EEPROM_ReadBytes(&cv, GF_BSP_EEPROM_CV_struct_define_Start_Address, sizeof(CV_struct_define)); GF_BSP_EEPROM_ReadBytes((uint8_t *)&cv, GF_BSP_EEPROM_CV_struct_define_Start_Address, sizeof(CV_struct_define));
return cv; return cv;
} }
@ -542,7 +542,7 @@ IAP_struct_define GF_BSP_EEPROM_Get_IAP(void)
{ {
IAP_struct_define iap= {0}; IAP_struct_define iap= {0};
GF_BSP_EEPROM_ReadBytes(&iap, IAP_struct_define_Start_Address, sizeof(IAP_struct_define)); GF_BSP_EEPROM_ReadBytes((uint8_t *)&iap, IAP_struct_define_Start_Address, sizeof(IAP_struct_define));
return iap; return iap;
} }

5
Bingoo/base/bsp_GPIO.c

@ -4,7 +4,7 @@
* Created on: Oct 26, 2023 * Created on: Oct 26, 2023
* Author: shiya * Author: shiya
*/ */
#include "BSP/bsp_GPIO.h" #include "bsp_GPIO.h"
uint8_t GF_BSP_GPIO_Init() uint8_t GF_BSP_GPIO_Init()
{ {
@ -47,6 +47,7 @@ void GF_BSP_GPIO_SetIO(uint8_t IO_Index,uint8_t Level)
} }
} }
#if 0
uint8_t GF_BSP_GPIO_ToggleIO(uint8_t IO_Index) uint8_t GF_BSP_GPIO_ToggleIO(uint8_t IO_Index)
{ {
@ -74,7 +75,7 @@ uint8_t GF_BSP_GPIO_ToggleIO(uint8_t IO_Index)
} }
#endif
uint8_t GF_BSP_GPIO_ReadIO(uint8_t IO_Index) uint8_t GF_BSP_GPIO_ReadIO(uint8_t IO_Index)
{ {

2
Bingoo/base/bsp_INTERCALL.c

@ -4,7 +4,7 @@
* Created on: 2023118 * Created on: 2023118
* Author: shiya * Author: shiya
*/ */
#include "BSP/bsp_include.h" #include "bsp_include.h"
typedef struct typedef struct
{ {

2
Bingoo/base/bsp_MB_host.c

@ -1,6 +1,6 @@
#include "bsp_MB_host.h" #include "bsp_MB_host.h"
#include "stdio.h" #include "stdio.h"
#include "BSP/bsp_UART.h" #include "bsp_UART.h"

4
Bingoo/base/bsp_TCPClient.c

@ -1,4 +1,4 @@
#include "BSP/bsp_TCPClient.h" #include "bsp_TCPClient.h"
#include "lwip/netif.h" #include "lwip/netif.h"
#include "lwip/ip.h" #include "lwip/ip.h"
#include "lwip/tcp.h" #include "lwip/tcp.h"
@ -165,7 +165,7 @@ static err_t client_connected(void *arg, struct tcp_pcb *pcb, err_t err)
void TCP_Client_Init(void) void TCP_Client_Init(void)
{ {
ReadLazorData = &ReceivedData[25]; ReadLazorData = (LazorData *)&ReceivedData[25];
Weld_Out_Flag = &ReceivedData[11]; Weld_Out_Flag = &ReceivedData[11];

4
Bingoo/base/bsp_TIMER.c

@ -4,9 +4,9 @@
* Created on: Oct 26, 2023 * Created on: Oct 26, 2023
* Author: shiya * Author: shiya
*/ */
#include "BSP/bsp_TIMER.h" #include "bsp_TIMER.h"
#include "lwip.h" #include "lwip.h"
#include "BSP/bsp_mqtt.h" #include "bsp_mqtt.h"
//返回值::1-正常;0-错误 //返回值::1-正常;0-错误
uint8_t GF_BSP_TIMER_Init() uint8_t GF_BSP_TIMER_Init()

2
Bingoo/base/bsp_UART.c

@ -1,4 +1,4 @@
#include "BSP/bsp_UART.h" #include "bsp_UART.h"
#include "main.h" #include "main.h"
#include <stdlib.h> #include <stdlib.h>

7
Bingoo/base/bsp_UDP.c

@ -12,7 +12,8 @@
#include "bsp_UDP.h" #include "bsp_UDP.h"
#include "bsp_DLT_Log.h" #include "bsp_DLT_Log.h"
#include <bsp_UpperComputer_Handler.h> #include <bsp_UpperComputer_Handler.h>
#include "BSP/bsp_GPIO.h" #include "bsp_GPIO.h"
#include "bsp_decode_command.h"
void UDP_GV_Dispatch(); void UDP_GV_Dispatch();
void UDP_IV_Dispatch(); void UDP_IV_Dispatch();
void udp_cmd_send_GV(char *pData, uint16_t Size); void udp_cmd_send_GV(char *pData, uint16_t Size);
@ -132,7 +133,7 @@ void udp_dlt_send_back(char *pData, uint16_t Size)
/* 发送udp数据 */ /* 发送udp数据 */
//udp_send(upcb_DLT, p); //udp_send(upcb_DLT, p);
err_t t = udp_sendto(upcb_Tx_DLT, p, &serverIP, (void)udp_sendto(upcb_Tx_DLT, p, &serverIP,
UDP_REMOTE_DLT_PORT); UDP_REMOTE_DLT_PORT);
/* 释放缓冲区空间 */ /* 释放缓冲区空间 */
pbuf_free(p); pbuf_free(p);
@ -395,7 +396,7 @@ void UDP_GV_Dispatch()
pb_ostream_t GV_o_stream = pb_ostream_t GV_o_stream =
{ 0 }; { 0 };
char buf[1024]; char buf[1024];
GV_o_stream = pb_ostream_from_buffer(&buf[2], sizeof(buf)); GV_o_stream = pb_ostream_from_buffer((pb_byte_t *)&buf[2], sizeof(buf));
pb_encode(&GV_o_stream, GV_struct_define_fields, &GV); pb_encode(&GV_o_stream, GV_struct_define_fields, &GV);
buf[1] = 0xfe; buf[1] = 0xfe;
buf[0] = 0xfe; buf[0] = 0xfe;

4
Bingoo/base/bsp_client_setting.c

@ -9,7 +9,7 @@
#include "gpio.h" #include "gpio.h"
#include "BSP/bsp_UART.h" #include "bsp_UART.h"
void UpdateIV(); void UpdateIV();
void decode_received_data_from_client(uint8_t *buffer, uint16_t length); void decode_received_data_from_client(uint8_t *buffer, uint16_t length);
@ -68,7 +68,7 @@ void decode_received_data_from_client(uint8_t *buffer, uint16_t length)
if (buffer[0] == 0x55 && buffer[1] == 0x55 && length >= 4) if (buffer[0] == 0x55 && buffer[1] == 0x55 && length >= 4)
{ {
uint16_t crc_check = ((buffer[length - 1] << 8) | buffer[length - 2]); uint16_t crc_check = ((buffer[length - 1] << 8) | buffer[length - 2]);
uint16_t crc_check1 = MB_CRC16(buffer, length - 2); //uint16_t crc_check1 = MB_CRC16(buffer, length - 2);
/* CRC 校验正确 */ /* CRC 校验正确 */
if (crc_check == MB_CRC16(buffer, length - 2)) if (crc_check == MB_CRC16(buffer, length - 2))
{ {

4
Bingoo/base/bsp_com_helper.c

@ -155,7 +155,7 @@ void PCOMHardWare_Check_t(HardWareController *uartHandler)
//printf("链表为空\n"); //printf("链表为空\n");
return; return;
} }
char IsAbnornalStatus = 0; //char IsAbnornalStatus = 0;
//check invalid state //check invalid state
while (ptr != NULL) while (ptr != NULL)
@ -167,7 +167,7 @@ void PCOMHardWare_Check_t(HardWareController *uartHandler)
LOGFF(DL_ERROR, "connecting Error %s", ptr->Name); LOGFF(DL_ERROR, "connecting Error %s", ptr->Name);
SET_BIT_1(SystemErrorCode,ptr->BitFlag); SET_BIT_1(SystemErrorCode,ptr->BitFlag);
//*SystemErrorCode=*SystemErrorCode|(1<<ptr->BitFlag); //*SystemErrorCode=*SystemErrorCode|(1<<ptr->BitFlag);
IsAbnornalStatus = 1; //IsAbnornalStatus = 1;
}else }else
{ {
//*SystemErrorCode=*SystemErrorCode|(1<<ptr->BitFlag); //*SystemErrorCode=*SystemErrorCode|(1<<ptr->BitFlag);

6
Bingoo/base/bsp_cpu_flash.c

@ -16,7 +16,7 @@
********************************************************************************************************* *********************************************************************************************************
*/ */
#include "BSP/bsp_cpu_flash.h" #include "bsp_cpu_flash.h"
#include <string.h> #include <string.h>
/* /*
********************************************************************************************************* *********************************************************************************************************
@ -413,6 +413,7 @@ void JumpToApp(void)
} }
} }
#if 0
/* /*
********************************************************************************************************* *********************************************************************************************************
* : JumpToApp * : JumpToApp
@ -468,7 +469,7 @@ void Copy_Peripheral_Download_Flash_to_App_Start(uint32_t totalBytes)
//App_Download_Addr //App_Download_Addr
//Read 32 bytes //Read 32 bytes
QSPI_W25Qx_Read_Buffer(&readData,CODE_DOWNLOAD_FLASH_BEGIN_ADDRESS+startIndex*sizeof(readData),256); QSPI_W25Qx_Read_Buffer((uint8_t *)&readData,CODE_DOWNLOAD_FLASH_BEGIN_ADDRESS+startIndex*sizeof(readData),256);
HAL_Delay(10); HAL_Delay(10);
//retult= bsp_ReadCpuFlash(App_Download_Addr+startIndex*sizeof(readData),readData,sizeof(readData)); //retult= bsp_ReadCpuFlash(App_Download_Addr+startIndex*sizeof(readData),readData,sizeof(readData));
//ucState = bsp_WriteCpuFlash((uint32_t)(AppAddr + TotalSize), (uint8_t *)&g_Can2RxData[8], RecSize); //ucState = bsp_WriteCpuFlash((uint32_t)(AppAddr + TotalSize), (uint8_t *)&g_Can2RxData[8], RecSize);
@ -479,6 +480,7 @@ void Copy_Peripheral_Download_Flash_to_App_Start(uint32_t totalBytes)
} }
#endif
void Erase_App_Download_Flash_Addr() void Erase_App_Download_Flash_Addr()
{ {
uint32_t startIndex=0; uint32_t startIndex=0;

1
Bingoo/base/bsp_decode_command.c

@ -16,6 +16,7 @@
#include "robot_move_actions.h" #include "robot_move_actions.h"
#include "fsm_state_control.h" #include "fsm_state_control.h"
#include "bsp_UDP.h"
#define success 1 #define success 1
#define fail 0 #define fail 0

2
Bingoo/base/bsp_tempature.c

@ -7,7 +7,7 @@
#include <bsp_tempature.h> #include <bsp_tempature.h>
#include "adc.h" #include "adc.h"
#include "BSP/bsp_include.h" #include "bsp_include.h"
#include "stm32h7xx_hal_adc.h" #include "stm32h7xx_hal_adc.h"
#include <math.h> #include <math.h>

5
Bingoo/base/fsm_state_control.c

@ -195,6 +195,7 @@ static void horizontal_backward_group(void)
static void manual_auto_group(void) static void manual_auto_group(void)
{ {
void Move_Manual_Auto_Sub_Func(void);
Move_Manual_Auto_Sub_Func(); Move_Manual_Auto_Sub_Func();
PaintGun_Contronl_Press(); PaintGun_Contronl_Press();
} }
@ -210,6 +211,7 @@ static void horizontal_auto_group(void)
static void weld_auto_group(void) static void weld_auto_group(void)
{ {
GV.Robot_Desired_Speed=-GV.Robot_Move_Speed; GV.Robot_Desired_Speed=-GV.Robot_Move_Speed;
void Weld_Auto_Sub_Func(void);
Weld_Auto_Sub_Func(); Weld_Auto_Sub_Func();
PaintGun_Contronl_Press(); PaintGun_Contronl_Press();
/* 若需喷枪控制,可在此添加 */ /* 若需喷枪控制,可在此添加 */
@ -242,6 +244,7 @@ static void vertical_backward_group(void)
static void vertical_auto_group(void) static void vertical_auto_group(void)
{ {
// horizontal_work(); // horizontal_work();
void Move_Vertical_Auto_Sub_Func(void);
Move_Vertical_Auto_Sub_Func(); Move_Vertical_Auto_Sub_Func();
PaintGun_Contronl_Press(); PaintGun_Contronl_Press();
/* 若需喷枪控制,可在此添加 */ /* 若需喷枪控制,可在此添加 */
@ -338,7 +341,9 @@ void GF_Dispatch(void)
// 更新调试变量 // 更新调试变量
g_debug_prev_mode = prev_mode; g_debug_prev_mode = prev_mode;
g_debug_curr_key = curr_key; g_debug_curr_key = curr_key;
void Compensation_Update(void);
Compensation_Update(); Compensation_Update();
void get_weld_data(void);
get_weld_data(); get_weld_data();
} }

6
Bingoo/base/msp_DAM_Relay.c

@ -5,9 +5,9 @@
* Author: akeguo * Author: akeguo
*/ */
#include "../../BASE/Inc/MSP/msp_DAM_Relay.h" #include "msp_DAM_Relay.h"
#include "../../BASE/Inc/BSP/BHBF_ROBOT.h" #include "BHBF_ROBOT.h"
#include "../../BASE/Inc/BSP/bsp_MB_host.h" #include "bsp_MB_host.h"
//not modbus writcoil //not modbus writcoil
uint8_t Dan1_open[8] = { 0xFE, 0x05, 0x00, 0x00, 0xFF, 0x00, 0x98, 0x35 }; uint8_t Dan1_open[8] = { 0xFE, 0x05, 0x00, 0x00, 0xFF, 0x00, 0x98, 0x35 };

2
Bingoo/base/msp_MK32_1.c

@ -4,7 +4,7 @@
* Created on: Oct 8, 2024 * Created on: Oct 8, 2024
* Author: akeguo * Author: akeguo
*/ */
#include "MSP/msp_MK32_1.h" #include "msp_MK32_1.h"
#include "BHBF_ROBOT.h" #include "BHBF_ROBOT.h"
char Is_All_Button_Reset = 0; char Is_All_Button_Reset = 0;

2
Bingoo/base/msp_TL720D.c

@ -5,7 +5,7 @@
* Author: bihon * Author: bihon
*/ */
#include "MSP/msp_TL720D.h" #include "msp_TL720D.h"
#include "BHBF_ROBOT.h" #include "BHBF_ROBOT.h"
#include "msp_TL720D.pb.h" #include "msp_TL720D.pb.h"

2
Bingoo/base/msp_TTMotor_ZQ.c

@ -207,6 +207,7 @@ void TT_SpeedMode_Set_TargetSpeed(uint32_t MotorID,
ZQ_Motor_Controller, WaitTime); ZQ_Motor_Controller, WaitTime);
} }
#if 0
void Swing_Motor_Set_Target_Position() void Swing_Motor_Set_Target_Position()
{ {
CANSendMessageSDO(SwingMotorID, 0x40, 0x6041, 0x00, 0x00); ///:是否到达目的位置 CANSendMessageSDO(SwingMotorID, 0x40, 0x6041, 0x00, 0x00); ///:是否到达目的位置
@ -217,6 +218,7 @@ void Swing_Motor_Read_ReachedEnd()
CANSendMessageSDO(SwingMotorID, 0x40, 0x6041, 0x00, 0x00); ///:是否到达目的位置 CANSendMessageSDO(SwingMotorID, 0x40, 0x6041, 0x00, 0x00); ///:是否到达目的位置
} }
#endif
void Set_Current_Positon_Zero(uint8_t MotorID, void Set_Current_Positon_Zero(uint8_t MotorID,
FDCANHandler *ZQ_Motor_Controller, int32_t WaitTime) // Home 设置当前位置为零点 FDCANHandler *ZQ_Motor_Controller, int32_t WaitTime) // Home 设置当前位置为零点

2
Bingoo/base/msp_WH_LTE_7S0.c

@ -3,7 +3,7 @@
#include "bsp_decode_command.h" #include "bsp_decode_command.h"
#include "gpio.h" #include "gpio.h"
#include "BSP/bsp_UART.h" #include "bsp_UART.h"
#include <msp_WH_LTE_7S0.h> #include <msp_WH_LTE_7S0.h>

25
Bingoo/base/msp_ground_management.c

@ -57,25 +57,25 @@ void ground_management_inquiry()
dataToSend[7] = SWAP_ENDIAN_16( dataToSend[7] = SWAP_ENDIAN_16(
(uint16_t ) ground_management_value->Time_Out_Period); (uint16_t ) ground_management_value->Time_Out_Period);
MB_WriteNumHoldingReg(&ground_management_handler->Tx_Buf, MB_WriteNumHoldingReg((uint8_t *)&ground_management_handler->Tx_Buf,
&ground_management_handler->TxCount, ground_management_slave_id, 0, (uint8_t *)&ground_management_handler->TxCount, ground_management_slave_id, 0,
8, dataToSend); 8, (uint8_t *)dataToSend);
ground_management_handler->AddSendList(ground_management_handler, ground_management_handler->AddSendList(ground_management_handler,
ground_management_handler->Tx_Buf, ground_management_handler->Tx_Buf,
ground_management_handler->TxCount, OneLineWaitTime, NULL); ground_management_handler->TxCount, OneLineWaitTime, NULL);
/***********寄存器8写德玛克电机速度*****************************/ /***********寄存器8写德玛克电机速度*****************************/
MB_WriteHoldingReg(&ground_management_handler->Tx_Buf, MB_WriteHoldingReg((uint8_t *)&ground_management_handler->Tx_Buf,
&ground_management_handler->TxCount, ground_management_slave_id, (uint8_t *)&ground_management_handler->TxCount, ground_management_slave_id,
8, GV.GroundManagementValue.DMK_Speed); 8, GV.GroundManagementValue.DMK_Speed);
ground_management_handler->AddSendList(ground_management_handler, ground_management_handler->AddSendList(ground_management_handler,
ground_management_handler->Tx_Buf, ground_management_handler->Tx_Buf,
ground_management_handler->TxCount, OneLineWaitTime, NULL); ground_management_handler->TxCount, OneLineWaitTime, NULL);
/***********寄存器9写德玛克电机状态*****************************/ /***********寄存器9写德玛克电机状态*****************************/
MB_WriteHoldingReg(&ground_management_handler->Tx_Buf, MB_WriteHoldingReg((uint8_t *)&ground_management_handler->Tx_Buf,
&ground_management_handler->TxCount, ground_management_slave_id, (uint8_t *)&ground_management_handler->TxCount, ground_management_slave_id,
9, GV.GroundManagementValue.DMK_WorkState); 9, GV.GroundManagementValue.DMK_WorkState);
ground_management_handler->AddSendList(ground_management_handler, ground_management_handler->AddSendList(ground_management_handler,
ground_management_handler->Tx_Buf, ground_management_handler->Tx_Buf,
@ -85,16 +85,16 @@ void ground_management_inquiry()
if (ground_management_value->Save_To_Flash == 1) if (ground_management_value->Save_To_Flash == 1)
{ {
/******************写寄存器7超时时间**************************/ /******************写寄存器7超时时间**************************/
MB_WriteHoldingReg(&ground_management_handler->Tx_Buf, MB_WriteHoldingReg((uint8_t *)&ground_management_handler->Tx_Buf,
&ground_management_handler->TxCount, ground_management_slave_id, (uint8_t *)&ground_management_handler->TxCount, ground_management_slave_id,
7, (uint16_t)ground_management_value->Time_Out_Period); 7, (uint16_t)ground_management_value->Time_Out_Period);
ground_management_handler->AddSendList(ground_management_handler, ground_management_handler->AddSendList(ground_management_handler,
ground_management_handler->Tx_Buf, ground_management_handler->Tx_Buf,
ground_management_handler->TxCount, OneLineWaitTime, NULL); ground_management_handler->TxCount, OneLineWaitTime, NULL);
/***************************寄存器10 写入55保存数据*************************************/ /***************************寄存器10 写入55保存数据*************************************/
MB_WriteHoldingReg(&ground_management_handler->Tx_Buf, MB_WriteHoldingReg((uint8_t *)&ground_management_handler->Tx_Buf,
&ground_management_handler->TxCount, ground_management_slave_id, (uint8_t *)&ground_management_handler->TxCount, ground_management_slave_id,
10, 55); 10, 55);
ground_management_handler->AddSendList(ground_management_handler, ground_management_handler->AddSendList(ground_management_handler,
ground_management_handler->Tx_Buf, ground_management_handler->Tx_Buf,
@ -104,7 +104,7 @@ void ground_management_inquiry()
} }
MB_ReadHoldingReg(&ground_management_handler->Tx_Buf, &ground_management_handler->TxCount, ground_management_slave_id, 0, MB_ReadHoldingReg((uint8_t *)&ground_management_handler->Tx_Buf, (uint8_t *)&ground_management_handler->TxCount, ground_management_slave_id, 0,
g_m_read_count); g_m_read_count);
ground_management_handler->AddSendList(ground_management_handler, ground_management_handler->Tx_Buf, ground_management_handler->AddSendList(ground_management_handler, ground_management_handler->Tx_Buf,
ground_management_handler->TxCount, OneLineWaitTime, decode_ground_management); ground_management_handler->TxCount, OneLineWaitTime, decode_ground_management);
@ -114,6 +114,7 @@ void decode_ground_management(uint8_t *buffer, uint16_t length)
{ {
// uint8_t data1[length]; // uint8_t data1[length];
// memcpy(data1, buffer, length); // memcpy(data1, buffer, length);
uint8_t MB_Decode_HoldingRegs(uint8_t buffer[], uint16_t length,uint16_t Read_Reg_Num,uint16_t* Decoded_Reg_Value);
int decoded_result = MB_Decode_HoldingRegs(buffer, length, g_m_read_count, int decoded_result = MB_Decode_HoldingRegs(buffer, length, g_m_read_count,
&decoded_ground_management_holdingReg_value[0]); &decoded_ground_management_holdingReg_value[0]);
if (decoded_result == 1) if (decoded_result == 1)

22
Bingoo/base/msp_strain_gauge.c

@ -45,15 +45,15 @@ void strain_gauge_loop()
// 必须要初始化 strainGaugeValue // 必须要初始化 strainGaugeValue
//读取力 //读取力
MB_ReadHoldingReg(&strain_gauge_handler->Tx_Buf, MB_ReadHoldingReg((uint8_t *)&strain_gauge_handler->Tx_Buf,
&strain_gauge_handler->TxCount, strain_gauge_slave_id, 1, 1); //03 command ; read 3 registers 从1 开始 读取1个 (uint8_t *)&strain_gauge_handler->TxCount, strain_gauge_slave_id, 1, 1); //03 command ; read 3 registers 从1 开始 读取1个
strain_gauge_handler->AddSendList(strain_gauge_handler, strain_gauge_handler->AddSendList(strain_gauge_handler,
strain_gauge_handler->Tx_Buf, strain_gauge_handler->TxCount, OneLineWaitTime, strain_gauge_handler->Tx_Buf, strain_gauge_handler->TxCount, OneLineWaitTime,
decode_strain_gauge_01); decode_strain_gauge_01);
//推杆控制 //推杆控制
MB_WriteHoldingReg(&strain_gauge_handler->Tx_Buf, MB_WriteHoldingReg((uint8_t *)&strain_gauge_handler->Tx_Buf,
&strain_gauge_handler->TxCount, strain_gauge_slave_id, 0, (uint8_t *)&strain_gauge_handler->TxCount, strain_gauge_slave_id, 0,
strainGaugeValue->MotorControl);//strainGaugeValue->MotorControl 电机控制,=0 停止,=1 前进,=2 后退 strainGaugeValue->MotorControl);//strainGaugeValue->MotorControl 电机控制,=0 停止,=1 前进,=2 后退
strain_gauge_handler->AddSendList(strain_gauge_handler, strain_gauge_handler->AddSendList(strain_gauge_handler,
strain_gauge_handler->Tx_Buf, strain_gauge_handler->TxCount, OneLineWaitTime, strain_gauge_handler->Tx_Buf, strain_gauge_handler->TxCount, OneLineWaitTime,
@ -63,15 +63,15 @@ void strain_gauge_loop()
if(SAVE_Register23==1) if(SAVE_Register23==1)
{ {
/*写寄存器2 K**/ /*写寄存器2 K**/
MB_WriteHoldingReg(&strain_gauge_handler->Tx_Buf, MB_WriteHoldingReg((uint8_t *)&strain_gauge_handler->Tx_Buf,
&strain_gauge_handler->TxCount, strain_gauge_slave_id, 2, (uint8_t *)&strain_gauge_handler->TxCount, strain_gauge_slave_id, 2,
strainGaugeValue->HX711_K); strainGaugeValue->HX711_K);
strain_gauge_handler->AddSendList(strain_gauge_handler, strain_gauge_handler->AddSendList(strain_gauge_handler,
strain_gauge_handler->Tx_Buf, strain_gauge_handler->TxCount, OneLineWaitTime, strain_gauge_handler->Tx_Buf, strain_gauge_handler->TxCount, OneLineWaitTime,
NULL); NULL);
/*写寄存器3 D**/ /*写寄存器3 D**/
MB_WriteHoldingReg(&strain_gauge_handler->Tx_Buf, MB_WriteHoldingReg((uint8_t *)&strain_gauge_handler->Tx_Buf,
&strain_gauge_handler->TxCount, strain_gauge_slave_id, 3, (uint8_t *)&strain_gauge_handler->TxCount, strain_gauge_slave_id, 3,
strainGaugeValue->HX711_D); strainGaugeValue->HX711_D);
strain_gauge_handler->AddSendList(strain_gauge_handler, strain_gauge_handler->AddSendList(strain_gauge_handler,
strain_gauge_handler->Tx_Buf, strain_gauge_handler->TxCount, OneLineWaitTime, strain_gauge_handler->Tx_Buf, strain_gauge_handler->TxCount, OneLineWaitTime,
@ -83,8 +83,8 @@ void strain_gauge_loop()
if(SAVE_Register9==1) if(SAVE_Register9==1)
{ {
MB_WriteHoldingReg(&strain_gauge_handler->Tx_Buf, MB_WriteHoldingReg((uint8_t *)&strain_gauge_handler->Tx_Buf,
&strain_gauge_handler->TxCount, strain_gauge_slave_id, 9, (uint8_t *)&strain_gauge_handler->TxCount, strain_gauge_slave_id, 9,
strainGaugeValue->Save); strainGaugeValue->Save);
strain_gauge_handler->AddSendList(strain_gauge_handler, strain_gauge_handler->AddSendList(strain_gauge_handler,
strain_gauge_handler->Tx_Buf, strain_gauge_handler->TxCount, OneLineWaitTime, strain_gauge_handler->Tx_Buf, strain_gauge_handler->TxCount, OneLineWaitTime,
@ -101,6 +101,7 @@ void decode_strain_gauge_01(uint8_t *buffer, uint16_t length)
// uint8_t data1[length]; // uint8_t data1[length];
// memcpy(data1, buffer, length); // memcpy(data1, buffer, length);
uint8_t MB_Decode_HoldingRegs(uint8_t buffer[], uint16_t length,uint16_t Read_Reg_Num,uint16_t* Decoded_Reg_Value);
int decoded_result = MB_Decode_HoldingRegs(buffer, length, 1, int decoded_result = MB_Decode_HoldingRegs(buffer, length, 1,
&decoded_strain_gauge_holdingReg_value[1]); &decoded_strain_gauge_holdingReg_value[1]);
if (decoded_result == 1) if (decoded_result == 1)
@ -121,6 +122,7 @@ void decode_strain_gauge_09(uint8_t *buffer, uint16_t length)
// uint8_t data1[100]; // uint8_t data1[100];
// memcpy(data1, buffer, length); // memcpy(data1, buffer, length);
uint8_t MB_Decode_HoldingRegs(uint8_t buffer[], uint16_t length,uint16_t Read_Reg_Num,uint16_t* Decoded_Reg_Value);
int decoded_result = MB_Decode_HoldingRegs(buffer, length, 2, int decoded_result = MB_Decode_HoldingRegs(buffer, length, 2,
&decoded_strain_gauge_holdingReg_value[9]); &decoded_strain_gauge_holdingReg_value[9]);
if (decoded_result == 1) if (decoded_result == 1)

9
Bingoo/base/robot_move_actions.c

@ -14,7 +14,7 @@
#include "fsm_state.h" #include "fsm_state.h"
#include "fsm_state_control.h" #include "fsm_state_control.h"
#include "paint_gun_action.h" #include "paint_gun_action.h"
#include "MSP/msp_PID.h" #include "msp_PID.h"
#include "bsp_slide_averager.h" #include "bsp_slide_averager.h"
#include <math.h> #include <math.h>
@ -697,11 +697,13 @@ static void swing_start_move(void)
if(present_angle>=left_compare_value+2) if(present_angle>=left_compare_value+2)
{ {
swing_currentState=SWING_LEFT_MOVE; swing_currentState=SWING_LEFT_MOVE;
void Move_Swing_Left_Func_Do_imm(void);
Move_Swing_Left_Func_Do_imm(); Move_Swing_Left_Func_Do_imm();
} }
else else
{ {
swing_currentState=SWING_RIGHT_MOVE; swing_currentState=SWING_RIGHT_MOVE;
void Move_Swing_Right_Func_Do_imm(void);
Move_Swing_Right_Func_Do_imm(); Move_Swing_Right_Func_Do_imm();
} }
} }
@ -721,7 +723,7 @@ static void swing_left_move(void)
center_angle=(right_compare_updata+left_compare_updata)/2; center_angle=(right_compare_updata+left_compare_updata)/2;
} }
void Move_Swing_Right_Func_Do_lay(void);
Move_Swing_Right_Func_Do_lay(); Move_Swing_Right_Func_Do_lay();
swing_currentState=SWING_RIGHT_MOVE; swing_currentState=SWING_RIGHT_MOVE;
@ -743,7 +745,7 @@ static void swing_right_move(void)
center_angle=(right_compare_updata+left_compare_updata)/2; center_angle=(right_compare_updata+left_compare_updata)/2;
} }
void Move_Swing_Left_Func_Do_lay(void);
Move_Swing_Left_Func_Do_lay(); Move_Swing_Left_Func_Do_lay();
swing_currentState=SWING_LEFT_MOVE; swing_currentState=SWING_LEFT_MOVE;
} }
@ -883,6 +885,7 @@ static void Move_Weld_Task_Backwards_Do_Backward(void)
double robotDeriAngleDegGrity=0; double robotDeriAngleDegGrity=0;
//GV.weld_data_X = ReadLazorData->Feature_X; //GV.weld_data_X = ReadLazorData->Feature_X;
float Robot_Weld_Real = GV.weld_data_X; float Robot_Weld_Real = GV.weld_data_X;
void GF_MSP_PID_Now_Der_adj_Com_Weld(double Current_Angle, double Desire_Angle_Input, double Auto_Speed, double Auto_Speed_Max, double System_time, double *W_Speed_1);
GF_MSP_PID_Now_Der_adj_Com_Weld(Robot_Weld_Real, robotDeriAngleDegGrity, GV.Robot_Move_Speed, Deri_Speed_Robot_MAX, 0.1, Robot_Speed); GF_MSP_PID_Now_Der_adj_Com_Weld(Robot_Weld_Real, robotDeriAngleDegGrity, GV.Robot_Move_Speed, Deri_Speed_Robot_MAX, 0.1, Robot_Speed);
GV.Left_Speed_M_min = Robot_Speed[1]; GV.Left_Speed_M_min = Robot_Speed[1];

1
Bingoo/base/swing_action.c

@ -46,6 +46,7 @@ void Robot_Swing_Operation_Function()
} }
else else
{ {
void Move_Swing_Halt_Func_Do(void);
Move_Swing_Halt_Func_Do(); Move_Swing_Halt_Func_Do();
} }
} }

4
Bingoo/base/tcp_server.c

@ -8,7 +8,7 @@
#include "bsp_UDP.h" #include "bsp_UDP.h"
#include "bsp_DLT_Log.h" #include "bsp_DLT_Log.h"
#include <bsp_UpperComputer_Handler.h> #include <bsp_UpperComputer_Handler.h>
#include "BSP/bsp_GPIO.h" #include "bsp_GPIO.h"
static client_conn_t clients[MAX_CLIENTS]; static client_conn_t clients[MAX_CLIENTS];
static struct tcp_pcb *server_pcb = NULL; static struct tcp_pcb *server_pcb = NULL;
void send_tcp(SendDataNode **head); void send_tcp(SendDataNode **head);
@ -149,7 +149,7 @@ static err_t tcp_accept_cb(void *arg, struct tcp_pcb *newpcb, err_t err)
tcp_setprio(newpcb, TCP_PRIO_MIN); tcp_setprio(newpcb, TCP_PRIO_MIN);
tcp_recv(newpcb, tcp_recv_cb); tcp_recv(newpcb, tcp_recv_cb);
tcp_err(newpcb, tcp_err_cb); tcp_err(newpcb, tcp_err_cb);
tcp_sent(newpcb, tcp_sent_cb); tcp_sent(newpcb, (tcp_sent_fn)tcp_sent_cb);
// 保存客户端信息 // 保存客户端信息
clients[free_index].pcb = newpcb; clients[free_index].pcb = newpcb;

42
Bingoo/include/base/BHBF_ROBOT.h

@ -20,32 +20,32 @@
#include "BHBF_ROBOT.h" #include "BHBF_ROBOT.h"
#include "bsp_PV.pb.h" #include "bsp_PV.pb.h"
#include "bsp_IV.pb.h" #include "bsp_IV.pb.h"
#include "BSP/bsp_TCPClient.h" #include "bsp_TCPClient.h"
#include "BSP/pb.h" #include "pb.h"
#include "BSP/pb_decode.h" #include "pb_decode.h"
#include "BSP/pb_encode.h" #include "pb_encode.h"
#include "BSP/bsp_EEPROM.h" #include "bsp_EEPROM.h"
#include "BSP/bsp_pb_decode_encode.h" #include "bsp_pb_decode_encode.h"
#include "bsp_MB_host.h" #include "bsp_MB_host.h"
#include "BSP/bsp_include.h" #include "bsp_include.h"
#include "BSP/bsp_UART.h" #include "bsp_UART.h"
#include "BSP/DLTuc.h" #include "DLTuc.h"
#include "BSP/bsp_DLT_Log.h" #include "bsp_DLT_Log.h"
#include "BSP/bsp_cpu_flash.h" #include "bsp_cpu_flash.h"
#include "BSP/bsp_qspi_w25q128.h" #include "bsp_qspi_w25q128.h"
#include "BSP/bsp_UpperComputer_Handler.h" #include "bsp_UpperComputer_Handler.h"
#include "BSP/bsp_Error_Detect.h" #include "bsp_Error_Detect.h"
#include "BSP/bsp_MB_host.h" #include "bsp_MB_host.h"
#include "MSP/msp_JTBATTERY.h" #include "msp_JTBATTERY.h"
#include "MSP/msp_Force_Sensor.h" #include "msp_Force_Sensor.h"
#include "MSP/msp_TL720D.h" #include "msp_TL720D.h"
#include "MSP/msp_MK32_1.h" #include "msp_MK32_1.h"
#include "MSP/msp_Force_Sensor.h" #include "msp_Force_Sensor.h"
#include "MSP/msp_WH_LTE_7S0.h" #include "msp_WH_LTE_7S0.h"
#include "paint_gun_action.h" #include "paint_gun_action.h"

2
Bingoo/include/base/bsp_Error_Detect.h

@ -12,7 +12,7 @@
/* Includes ------------------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/
#include "BHBF_ROBOT.h" #include "BHBF_ROBOT.h"
#include "bsp_com_helper.h" #include "bsp_com_helper.h"
#include "BSP/bsp_include.h" #include "bsp_include.h"
/* Exported types ------------------------------------------------------------*/ /* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/

2
Bingoo/include/base/bsp_MB_host.h

@ -12,7 +12,7 @@
#define InputRegReg 0x0020 //输入寄存器 #define InputRegReg 0x0020 //输入寄存器
#define SWAP_ENDIAN_16(x) (((x) >> 8) | ((x) << 8)) #define SWAP_ENDIAN_16(x) (((x) >> 8) | ((x) << 8))
#include "bsp_include.h" #include "bsp_include.h"
#include "BSP/bsp_UART.h" #include "bsp_UART.h"
/* 扩展变量 ------------------------------------------------------------------*/ /* 扩展变量 ------------------------------------------------------------------*/
typedef struct typedef struct

1
Bingoo/include/base/bsp_TCPClient.h

@ -57,7 +57,6 @@ typedef struct _LazorData
} LazorData; } LazorData;
extern unsigned char *Weld_Out_Flag; extern unsigned char *Weld_Out_Flag;
extern unsigned char Weld_Out_Count; extern unsigned char Weld_Out_Count;
extern unsigned char Weld_Out_SafeCount;
extern LazorData *ReadLazorData; extern LazorData *ReadLazorData;
void TCP_Client_Init(void); void TCP_Client_Init(void);
#endif /* INC_BSP_BSP_TCPCLIENT_H_ */ #endif /* INC_BSP_BSP_TCPCLIENT_H_ */

2
Bingoo/include/base/bsp_TIMER.h

@ -7,7 +7,7 @@
#ifndef INC_BSP_TIMER_H_ #ifndef INC_BSP_TIMER_H_
#define INC_BSP_TIMER_H_ #define INC_BSP_TIMER_H_
#include "BSP/bsp_TCPClient.h" #include "bsp_TCPClient.h"
#include "bsp_include.h" #include "bsp_include.h"
uint8_t GF_BSP_TIMER_Init(void); uint8_t GF_BSP_TIMER_Init(void);

2
Bingoo/include/base/bsp_UART.h

@ -3,7 +3,7 @@
#ifndef INC_BSP_UART_H_ #ifndef INC_BSP_UART_H_
#define INC_BSP_UART_H_ #define INC_BSP_UART_H_
#include "BSP/bsp_include.h" #include "bsp_include.h"
#include "main.h" #include "main.h"
#include "bsp_Error.pb.h" #include "bsp_Error.pb.h"
#define UART_Transmit_MAX_NUM 1024 #define UART_Transmit_MAX_NUM 1024

2
Bingoo/include/base/bsp_UpperComputer_Handler.h

@ -11,7 +11,7 @@
#include <string.h> #include <string.h>
#include "bsp_MB_host.h" #include "bsp_MB_host.h"
#include "stdio.h" #include "stdio.h"
#include "BSP/bsp_UART.h" #include "bsp_UART.h"
#include "usart.h" #include "usart.h"
#include "gpio.h" #include "gpio.h"

2
Bingoo/include/base/bsp_mqtt_pub.h

@ -13,7 +13,7 @@
#include "pb_encode.h" #include "pb_encode.h"
#include "bsp_CV.pb.h" #include "bsp_CV.pb.h"
#include "bsp_pb_decode_encode.h" #include "bsp_pb_decode_encode.h"
#include "BSP/bsp_EEPROM.h" #include "bsp_EEPROM.h"

2
Bingoo/include/base/msp_JTBATTERY.h

@ -8,7 +8,7 @@
#ifndef INC_MSP_MSP_JTBATTERY_H_ #ifndef INC_MSP_MSP_JTBATTERY_H_
#define INC_MSP_MSP_JTBATTERY_H_ #define INC_MSP_MSP_JTBATTERY_H_
#include "BSP/bsp_include.h" #include "bsp_include.h"

2
Bingoo/include/base/msp_MK32_1.h

@ -7,7 +7,7 @@
#ifndef INC_MSP_MSP_MK32_1_H_ #ifndef INC_MSP_MSP_MK32_1_H_
#define INC_MSP_MSP_MK32_1_H_ #define INC_MSP_MSP_MK32_1_H_
#include "BSP/bsp_UART.h" #include "bsp_UART.h"
#include "msp_MK32.pb.h" #include "msp_MK32.pb.h"
void Sbus_Data_Count(uint8_t *buf, int32_t *But_Value); void Sbus_Data_Count(uint8_t *buf, int32_t *But_Value);
extern SP_MSP_MK32_Button *P_MK32; extern SP_MSP_MK32_Button *P_MK32;

2
Bingoo/include/base/msp_TL720D.h

@ -12,7 +12,7 @@
#include <string.h> #include <string.h>
#include "bsp_MB_host.h" #include "bsp_MB_host.h"
#include "stdio.h" #include "stdio.h"
#include "BSP/bsp_UART.h" #include "bsp_UART.h"
#include "usart.h" #include "usart.h"
#include "gpio.h" #include "gpio.h"

1
Bingoo/library/CMakeLists.txt

@ -252,7 +252,6 @@ endif()
target_compile_options(${CURRENT_TARGET_NAME} target_compile_options(${CURRENT_TARGET_NAME}
PRIVATE PRIVATE
-Wall -Wall
-Werror
$<$<CONFIG:Debug>:-g -O0> $<$<CONFIG:Debug>:-g -O0>
$<$<CONFIG:Release>:-O2> $<$<CONFIG:Release>:-O2>
-ffunction-sections -fdata-sections -ffunction-sections -fdata-sections

1
Bingoo/main/CMakeLists.txt

@ -48,7 +48,6 @@ endif()
target_compile_options(${TARGET_NAME} target_compile_options(${TARGET_NAME}
PRIVATE PRIVATE
-Wall -Wall
-Werror
$<$<CONFIG:Debug>:-g -O0> $<$<CONFIG:Debug>:-g -O0>
$<$<CONFIG:Release>:-O2> $<$<CONFIG:Release>:-O2>
) )

1
Core/Src/main.c

@ -37,6 +37,7 @@
#include "msp_ground_management.h" #include "msp_ground_management.h"
#include "msp_strain_gauge.h" #include "msp_strain_gauge.h"
#include <bsp_tempature.h> #include <bsp_tempature.h>
#include "msp_TTMotor_ZQ.h"
/* USER CODE END Includes */ /* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/ /* Private typedef -----------------------------------------------------------*/

Loading…
Cancel
Save