Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Servo mbed-rtos mbed
diag.cpp
00001 #include "car_config.hpp" 00002 #include "can.hpp" 00003 #include "net.hpp" 00004 #include "mbed.h" 00005 #include "rtos.h" 00006 00007 void init_diag () { 00008 } 00009 00010 void thread_diag (void const *args) { 00011 while(1) { 00012 if (can_cmd_diag.flag == CAN_FLAG_RECEIVED) { 00013 uint16 cmd = can_cmd_diag.payload.msg.cmd; 00014 uint32 data = can_cmd_diag.payload.msg.data; 00015 switch(cmd) { 00016 case CMD_ECHO: 00017 can_sts_diag.payload.msg.data = data; 00018 can_sts_diag.flag = CAN_FLAG_SEND; 00019 break; 00020 default: 00021 //ignore it 00022 break; 00023 } 00024 can_cmd_diag.flag = CAN_FLAG_EMPTY; 00025 } 00026 Thread::wait(DIAG_THREAD_PERIOD); 00027 } 00028 }
Generated on Wed Aug 3 2022 13:20:54 by
1.7.2