CANMessage is the primitive CAN message object. It supports creation, parsing, formatting of messages. Can be easily integrated with CANPort and CANQueue libraries.

Revision:
4:4ba6856f7b4f
Parent:
3:c2a26d9d689b
--- a/CANMessage.cpp	Fri Sep 20 21:56:43 2019 +0000
+++ b/CANMessage.cpp	Wed Oct 23 21:38:12 2019 +0000
@@ -54,7 +54,7 @@
         timer.start();
         timer_on = true;
     }
-    timestamp = timer.read_high_resolution_us();
+    timestamp = (uint32_t)timer.read_us(); // read_high_resolution_us();
 }
 
 CANmsg::CANmsg(CANCHANNEL_T _ch, CANDIR_T _dir, CANMessage _msg) {
@@ -62,7 +62,7 @@
         timer.start();
         timer_on = true;
     }
-    timestamp = timer.read_high_resolution_us();
+    timestamp = (uint32_t)timer.read_us(); // read_high_resolution_us();
     ch = _ch;
     dir = _dir;
     id = _msg.id;
@@ -120,14 +120,14 @@
     token = strtok(NULL, search);
     // lostMessages = atoi(token);
     token = strtok(NULL, search);
-    timestamp = timer.read_high_resolution_us();        // set it to "now"
+    timestamp = (uint32_t)timer.read_us(); // read_high_resolution_us();        // set it to "now"
     if (token)
         timestamp = (uint32_t)(1000000 * atof(token));
     return true;
 }
 
 void CANmsg::SetTimestamp() {
-    timestamp = (uint32_t)timer.read_high_resolution_us();
+    timestamp = (uint32_t)timer.read_us(); // read_high_resolution_us();
 }
 
 // 12345678901234567890123456789012345678901234567890123456789012345