fix bugs
This commit is contained in:
parent
4d27bd9b0f
commit
4d32450e3d
|
@ -36,7 +36,6 @@
|
||||||
#include "bsp_usart.h"
|
#include "bsp_usart.h"
|
||||||
#include "bsp_can.h"
|
#include "bsp_can.h"
|
||||||
#include "can.h"
|
#include "can.h"
|
||||||
#include "LK9025.h"
|
|
||||||
#include "dji_motor.h"
|
#include "dji_motor.h"
|
||||||
#include "motor_task.h"
|
#include "motor_task.h"
|
||||||
/* USER CODE END Includes */
|
/* USER CODE END Includes */
|
||||||
|
|
|
@ -34,7 +34,7 @@ void DrivenControl(int16_t motor1_current,int16_t motor2_current)
|
||||||
driven_motor_info[0]->motor_can_instance->tx_buff[1] = motor1_current>>8;
|
driven_motor_info[0]->motor_can_instance->tx_buff[1] = motor1_current>>8;
|
||||||
driven_motor_info[0]->motor_can_instance->tx_buff[2] = motor2_current;
|
driven_motor_info[0]->motor_can_instance->tx_buff[2] = motor2_current;
|
||||||
driven_motor_info[0]->motor_can_instance->tx_buff[3] = motor2_current>>8;
|
driven_motor_info[0]->motor_can_instance->tx_buff[3] = motor2_current>>8;
|
||||||
CANTransmit(&driven_motor_info[0]->motor_can_instance);
|
CANTransmit(driven_motor_info[0]->motor_can_instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetDrivenMode(driven_mode cmd,uint16_t motor_id)
|
void SetDrivenMode(driven_mode cmd,uint16_t motor_id)
|
||||||
|
|
|
@ -55,7 +55,7 @@ static void ReceiveCallback()
|
||||||
sbus_to_rc(rc_usart_instance.recv_buff, &rc_ctrl);
|
sbus_to_rc(rc_usart_instance.recv_buff, &rc_ctrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
RC_ctrl_t* RC_init(UART_HandleTypeDef *rc_usart_handle)
|
RC_ctrl_t *RC_init(UART_HandleTypeDef *rc_usart_handle)
|
||||||
{
|
{
|
||||||
rc_usart_instance.module_callback = ReceiveCallback;
|
rc_usart_instance.module_callback = ReceiveCallback;
|
||||||
rc_usart_instance.usart_handle = rc_usart_handle;
|
rc_usart_instance.usart_handle = rc_usart_handle;
|
||||||
|
@ -64,7 +64,7 @@ RC_ctrl_t* RC_init(UART_HandleTypeDef *rc_usart_handle)
|
||||||
return &rc_ctrl;
|
return &rc_ctrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
const *get_remote_control_point(void)
|
const RC_ctrl_t *get_remote_control_point(void)
|
||||||
{
|
{
|
||||||
|
return &rc_ctrl;
|
||||||
}
|
}
|
|
@ -75,4 +75,10 @@ typedef struct
|
||||||
*/
|
*/
|
||||||
RC_ctrl_t *RC_init(UART_HandleTypeDef *rc_usart_handle);
|
RC_ctrl_t *RC_init(UART_HandleTypeDef *rc_usart_handle);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the remote control point object
|
||||||
|
*
|
||||||
|
* @return const RC_ctrl_t*
|
||||||
|
*/
|
||||||
|
const RC_ctrl_t *get_remote_control_point(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue