feat: 增加can总线和步进电机指令绑定
This commit is contained in:
14
app/by_can.c
14
app/by_can.c
@@ -26,14 +26,16 @@ by_error_status by_can_send_stdd(uint32_t id, const uint8_t *data, uint8_t len,
|
||||
transmit_mailbox = can_message_transmit(CAN1, &tx_message_struct); /* 将以上待发送报文写入发送邮箱并请求发送 */
|
||||
|
||||
/* 等待该邮箱发送成功—对应邮箱发送成功标志置起 */
|
||||
while (can_transmit_status_get(CAN1, (can_tx_mailbox_num_type)transmit_mailbox) != CAN_TX_STATUS_SUCCESSFUL) {
|
||||
// LOGD("CAN#SEND: timeout=%d", timeout);
|
||||
if (0 == timeout--) {
|
||||
LOGW("CAN#TIMEOUT: ID=0x%x", id);
|
||||
if (timeout) {
|
||||
while (can_transmit_status_get(CAN1, (can_tx_mailbox_num_type)transmit_mailbox) != CAN_TX_STATUS_SUCCESSFUL) {
|
||||
// LOGD("CAN#SEND: timeout=%d", timeout);
|
||||
if (0 == timeout--) {
|
||||
LOGW("CAN#TIMEOUT: ID=0x%x", id);
|
||||
|
||||
return BY_ERROR;
|
||||
return BY_ERROR;
|
||||
}
|
||||
DWT_Delay(10);
|
||||
}
|
||||
DWT_Delay(10);
|
||||
}
|
||||
|
||||
return BY_SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user