| | |
| | | void IdleTask(void) |
| | | { |
| | | |
| | | UART_CheckReceive(); |
| | | UART_CheckReceive(); |
| | | UART_CheckSend(); |
| | | |
| | | if(heartbeat_timer>1000) |
| | |
| | | // NVIC_SystemReset(); |
| | | // } |
| | | // } |
| | | flag_newsecond=0; |
| | | flag_newsecond=0; |
| | | tagpos_binary=0; |
| | | memcpy(ancidlist_send,ancidlist_rec,ancidlist_num*2); |
| | | ancidlist_num=0; |
| | |
| | | g_com_map[RELAY2_STATE_INDEX] = READ_RELAY2; |
| | | |
| | | } |
| | | uint8_t at_cmd[3]={0x2B,0x2B,0x2B}; |
| | | uint8_t at_cmd1[2]={0x41,0x54}; |
| | | char at_cmd2[20]={"AT+CAN=500,70,NDTF\r\n"}; //AT+CAN?\r\n |
| | | char at_cmd3[9]={"AT+CAN?\r\n"}; |
| | | char at_cmd4[9]={"AT+EXAT\r\n"}; |
| | | void send_to_ECAN() |
| | | { |
| | | // UART_PushFrame(at_cmd,3); |
| | | // |
| | | // UART_PushFrame(at_cmd1,2); |
| | | //// delay_ms(1); |
| | | // UART_PushFrame((uint8_t*)at_cmd2,20); |
| | | //// delay_ms(1); |
| | | // UART_PushFrame((uint8_t*)at_cmd3,9); |
| | | //// delay_ms(1); |
| | | // UART_PushFrame((uint8_t*)at_cmd4,9); |
| | | printf("+++"); |
| | | delay_ms(20); |
| | | printf("AT"); |
| | | delay_ms(20); |
| | | printf("AT+CAN=500,0,NDTF\r\n"); |
| | | delay_ms(1); |
| | | printf("AT+CAN?\r\n"); |
| | | delay_ms(1); |
| | | printf("AT+EXAT\r\n"); |
| | | } |
| | | |
| | | int main(void) |
| | | { |
| | |
| | | usart_send[1]=0xAA; |
| | | usart_send_anc[0]=0x55; |
| | | usart_send_anc[1]=0xAA; |
| | | |
| | | send_to_ECAN(); |
| | | while(1) |
| | | { |
| | | |
| | | g_start_sync_flag=0; |
| | | if(g_start_send_flag) |
| | | { |