|
@@ -11,6 +11,10 @@ void protocol_send_bms_info(uint8_t dest, uint8_t key, uint8_t *data, int len){
|
|
|
can_frame_t can_frame;
|
|
can_frame_t can_frame;
|
|
|
CAN_OUT(&(can_frame.head), dest);
|
|
CAN_OUT(&(can_frame.head), dest);
|
|
|
can_frame.key = key;
|
|
can_frame.key = key;
|
|
|
|
|
+#if (CONFIG_BOARD_TYPE==SHARK_BOARD_SP700)
|
|
|
|
|
+ u8 dumy_bytes[2] = {0xaa, 0xaa}; //ÈúìÍâÕý³£
|
|
|
|
|
+ shark_uart_write_bytes(current_uart, dumy_bytes, sizeof(dumy_bytes));
|
|
|
|
|
+#endif
|
|
|
shark_uart_frame_start(current_uart, (uint8_t *)&can_frame, sizeof(can_frame));
|
|
shark_uart_frame_start(current_uart, (uint8_t *)&can_frame, sizeof(can_frame));
|
|
|
shark_uart_frame_continue(current_uart, data, len);
|
|
shark_uart_frame_continue(current_uart, data, len);
|
|
|
shark_uart_frame_end(current_uart);
|
|
shark_uart_frame_end(current_uart);
|
|
@@ -54,6 +58,7 @@ void protocol_notify_old_frame(uart_enum_t uart_no){
|
|
|
shark_uart_write_bytes(current_uart, (uint8_t *)&head, head.size);
|
|
shark_uart_write_bytes(current_uart, (uint8_t *)&head, head.size);
|
|
|
}
|
|
}
|
|
|
extern u32 uart_new_prot;
|
|
extern u32 uart_new_prot;
|
|
|
|
|
+extern u64 uart_frame_time;
|
|
|
void protocol_recv_frame(uart_enum_t uart_no, uint8_t *data, int len){
|
|
void protocol_recv_frame(uart_enum_t uart_no, uint8_t *data, int len){
|
|
|
current_uart = uart_no;
|
|
current_uart = uart_no;
|
|
|
if (len < sizeof(can_frame_t)){
|
|
if (len < sizeof(can_frame_t)){
|
|
@@ -66,6 +71,8 @@ void protocol_recv_frame(uart_enum_t uart_no, uint8_t *data, int len){
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
uart_new_prot++;
|
|
uart_new_prot++;
|
|
|
|
|
+ uart_frame_time = shark_get_mseconds();
|
|
|
|
|
+
|
|
|
len -= sizeof(can_frame_t);
|
|
len -= sizeof(can_frame_t);
|
|
|
if (can_frame->key >= CAN_KEY_IAP_ENTER){
|
|
if (can_frame->key >= CAN_KEY_IAP_ENTER){
|
|
|
process_iap_message(can_frame, len);
|
|
process_iap_message(can_frame, len);
|