|
@@ -80,6 +80,8 @@ shark_bool shark_can_send_frame(shark_can_efid_t efid, const void *buff, u8 leng
|
|
|
u8 tail = (shark_can_tx_tail + 1) % NELEM(shark_can_tx_queue);
|
|
u8 tail = (shark_can_tx_tail + 1) % NELEM(shark_can_tx_queue);
|
|
|
shark_can_frame_t *frame;
|
|
shark_can_frame_t *frame;
|
|
|
|
|
|
|
|
|
|
+ shark_can_tx_flush();
|
|
|
|
|
+
|
|
|
if (tail == shark_can_tx_head || work_normal == 0) {
|
|
if (tail == shark_can_tx_head || work_normal == 0) {
|
|
|
return shark_false;
|
|
return shark_false;
|
|
|
}
|
|
}
|
|
@@ -109,7 +111,7 @@ shark_bool shark_can_send(u8 dest, u8 src, u8 type, const u8 *buff, u16 length)
|
|
|
efid.total = (length + 7) / 8;
|
|
efid.total = (length + 7) / 8;
|
|
|
|
|
|
|
|
while (length > 0) {
|
|
while (length > 0) {
|
|
|
- u8 wrlen = length > 8 ? 8 : length;
|
|
|
|
|
|
|
+ u8 wrlen = length < 8 ? length : 8;
|
|
|
|
|
|
|
|
efid.index = index;
|
|
efid.index = index;
|
|
|
efid.length = wrlen - 1;
|
|
efid.length = wrlen - 1;
|