2021A Conste RX/TX lib

Dependents:   R21_ConsteSlave2

Files at this revision

API Documentation at this revision

Comitter:
TakushimaYukimasa
Date:
Sat Nov 20 00:08:11 2021 +0000
Parent:
8:9fb5088cd76f
Commit message:
fix jikanzure goriosi puroguramu

Changed in this revision

conste.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 9fb5088cd76f -r 686c51030019 conste.cpp
--- a/conste.cpp	Fri Nov 12 12:53:59 2021 +0000
+++ b/conste.cpp	Sat Nov 20 00:08:11 2021 +0000
@@ -70,14 +70,17 @@
 
         /* チェックサム整合性がとれるならデータ更新 */
         if(checkSum == (arrayRestore[0] & 0xFE) >> 1) {
-            timeMs = 0;
-            timeMs |= (arrayRestore[0] & 0x01) << 16;
-            timeMs |= (arrayRestore[1] & 0xFF) << 8;
-            timeMs |= (arrayRestore[2] & 0xFF) << 0;
-
             isStart = (arrayRestore[3] >> 7) & 0x01;
             isEMO = (arrayRestore[3] >> 6) & 0x01;
 
+            if(!isStart) {
+
+                timeMs = 0;
+                timeMs |= (arrayRestore[0] & 0x01) << 16;
+                timeMs |= (arrayRestore[1] & 0xFF) << 8;
+                timeMs |= (arrayRestore[2] & 0xFF) << 0;
+            }
+
             RobotStat[0] = (arrayRestore[3] >> 4) & 0x03;
             RobotStat[1] = (arrayRestore[3] >> 2) & 0x03;
             RobotStat[2] = (arrayRestore[3] >> 0) & 0x03;