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.
CAN_stack.cpp
00001 #include "CAN_stack.h" 00002 00003 extern DigitalOut* myled; 00004 00005 CAN_stack::CAN_stack(CAN* can_int) 00006 { 00007 adapter=can_int; 00008 adapter->attach(this, &CAN_stack::can_callback); 00009 } 00010 00011 void CAN_stack::poll (void) 00012 { 00013 /* 00014 pop fifo and do stuff 00015 */ 00016 } 00017 00018 void CAN_stack::can_callback ( void ) 00019 { 00020 if (myled->read()) 00021 { 00022 myled->write(0); 00023 } 00024 00025 else 00026 { 00027 myled->write(1); 00028 } 00029 00030 CANMessage msg; 00031 adapter->read(msg); 00032 00033 /* 00034 push msg to fifo etc 00035 */ 00036 }
Generated on Sun Jul 31 2022 18:00:22 by
1.7.2