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: DataControl
Diff: ikarashiCAN.cpp
- Revision:
- 2:05d0790d0fc6
- Parent:
- 0:b9571508f055
- Child:
- 5:664bd71935c3
--- a/ikarashiCAN.cpp Tue Aug 23 17:04:29 2022 +0000
+++ b/ikarashiCAN.cpp Fri Aug 26 14:25:54 2022 +0000
@@ -33,19 +33,17 @@
//---attach function---------------------------------------//
void ikarashiCAN::send()
{
+ can_s = 0;
if(can.write(CANMessage(_msgID, sender, separated_data_size))) {
can_s = 1;
- } else {
- can_s = 0;
}
}
void ikarashiCAN::recieve()
{
+ can_r = 0;
if(can.read(msg)) {
can_r = 1;
- }else{
- can_r = 0;
}
}
//--------------------------------------------------------//
@@ -68,10 +66,8 @@
int ikarashiCAN::simpleGetData(int _id){
if(_id == msg.id && can_r){
_can_data = getData();
- return getData();
- }else{
- return _can_data;
}
+ return _can_data;
}