增加了LK电机和HT电机的基本支持,待编写控制

This commit is contained in:
NeoZng
2022-12-13 19:40:03 +08:00
parent 2f41e67de0
commit 11329aaddb
21 changed files with 280 additions and 171 deletions

View File

@@ -115,7 +115,7 @@ static void CANFIFOxCallback(CAN_HandleTypeDef *_hcan, uint32_t fifox)
uint8_t can_rx_buff[8];
CAN_RxHeaderTypeDef rxconf;
HAL_CAN_GetRxMessage(_hcan, fifox, &rxconf, can_rx_buff);
for (size_t i = 0; i < MX_REGISTER_DEVICE_CNT; i++)
for (size_t i = 0; i < MX_REGISTER_DEVICE_CNT; ++i)
{
if (instance[i] != NULL) // 碰到NULL说明已经遍历完所有实例
{ // 两者相等说明这是要找的实例

View File

@@ -70,7 +70,7 @@ void USARTSend(USARTInstance *_instance, uint8_t *send_buf, uint16_t send_size)
*/
void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t Size)
{
for (uint8_t i = 0; i < 3; i++)
for (uint8_t i = 0; i < 3; ++i)
{
if (huart == instance[i]->usart_handle)
{
@@ -93,7 +93,7 @@ void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t Size)
*/
void HAL_UART_ErrorCallback(UART_HandleTypeDef *huart)
{
for (uint8_t i = 0; i < 3; i++)
for (uint8_t i = 0; i < 3; ++i)
{
if (huart == instance[i]->usart_handle)
{