ichinoseki_Bteam_2019 / Mycan

Dependents:   2019_SwitchNode_AR ArmNode 2919_LineSensor 2019_MD ... more

Files at this revision

API Documentation at this revision

Comitter:
TanakaTarou
Date:
Sat Sep 21 11:59:57 2019 +0000
Parent:
7:cac42b73a4f6
Commit message:
CAN Library

Changed in this revision

Mycan.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Mycan.cpp	Mon Sep 02 05:09:45 2019 +0000
+++ b/Mycan.cpp	Sat Sep 21 11:59:57 2019 +0000
@@ -40,8 +40,13 @@
 
 bool Mycan::send()
 {
-    if (!write_type) return can.write(CANMessage(td_id, (char*)&td_integer, 8));
-    else if (write_type) return can.write(CANMessage(td_id, (char*)&td_decimal, 8));
+    bool return_val;
+    if(!write_type) 
+        return_val = can.write(CANMessage(td_id, (char*)&td_integer, 8));
+    else if(write_type) 
+        return_val = can.write(CANMessage(td_id, (char*)&td_decimal, 8));
+    
+    return return_val;
 }
 
 void Mycan::readI()
@@ -72,9 +77,13 @@
 
 float Mycan::get(uint32_t _id, int _num)
 {
+    float return_val;
     rd_id = _id;
     rd_num = _num;
-    if (!read_type) return integer_values_storage[rd_id].value[rd_num];
-    else if (read_type) return decimal_values_storage[rd_id].value[rd_num];
-}
-
+    if(!read_type) 
+        return_val = integer_values_storage[rd_id].value[rd_num];
+    else if(read_type) 
+        return_val = decimal_values_storage[rd_id].value[rd_num];
+    
+    return return_val;
+}
\ No newline at end of file