asd

Fork of IntegrationCAN by Nenad Djalovic

Files at this revision

API Documentation at this revision

Comitter:
Tafkal
Date:
Sun Jun 17 11:58:03 2018 +0000
Parent:
2:884c10989f0d
Commit message:
Lol;

Changed in this revision

CAN_library.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 884c10989f0d -r c9a444d3fe1b CAN_library.cpp
--- a/CAN_library.cpp	Fri May 25 08:43:09 2018 +0000
+++ b/CAN_library.cpp	Sun Jun 17 11:58:03 2018 +0000
@@ -1,8 +1,8 @@
 #include "CAN_library.h"
 
 extern CAN can;
-extern Serial pc;
-extern CANMessage msgDTA1, msgDTA2, msgDTA3, msgDTA4, msgDTA5, msgDTA6, msgLVDTFront, msgLVDTRear, msgBrakes;
+//extern Serial pc;
+extern CANMessage msgDTA1, msgDTA2, msgDTA3, msgDTA4, msgDTA5, msgDTA6, msgLVDTFront, msgLVDTRear, msgBrakes, msgKm;
 extern uint16_t rx_flag;
 extern uint8_t lvdtref;
 extern Serial tRF;
@@ -54,6 +54,10 @@
                 rx_flag|=(1<<8);
                 msgBrakes=tmpMsg;
                 break;
+            case(9):
+                rx_flag|=(1<<9);
+                msgKm=tmpMsg;
+                break;
         };
         //pc.printf("rx_flag=%d\n",rx_flag);
     };
@@ -112,6 +116,7 @@
                     UpdateInfoBrakes(newData);
                     rx_flag = rx_flag ^ (1<<8);
                     break;
+                    //TODO: Resiti primanje KM
                 // for each new id add new case statement
             };
         };
@@ -181,15 +186,15 @@
         }else{
             FL_LVDT=(FL_LVDT-FL_LVDT_Ref)*100/FL_LVDT_Ref;
         };
-        pc.printf("Im in 1\n");
+        //pc.printf("Im in 1\n");
     }else{    
         FL_LVDT_Ref=FL_LVDT;
         FL_LVDT=0;
         lvdtref=lvdtref^(1<<3);
-        pc.printf("Ref=%d\n",FL_LVDT_Ref);
+        //pc.printf("Ref=%d\n",FL_LVDT_Ref);
     };
-    pc.printf("FL_LVDT=%d, FL_LVDT0=%d\n",abs(FL_LVDT),abs(FL_LVDT0));
-    pc.printf("FR_LVDT=%d, FR_LVDT0=%d\n",abs(FR_LVDT),abs(FR_LVDT0)); 
+    //pc.printf("FL_LVDT=%d, FL_LVDT0=%d\n",abs(FL_LVDT),abs(FL_LVDT0));
+    //pc.printf("FR_LVDT=%d, FR_LVDT0=%d\n",abs(FR_LVDT),abs(FR_LVDT0)); 
         
     if(!(lvdtref & (1<<2))){
         if (FR_LVDT>FR_LVDT_Ref){
@@ -233,8 +238,8 @@
         RR_LVDT=0;
         lvdtref=lvdtref^(1<<0);
     };
-    pc.printf("RL_LVDT=%d, RL_LVDT0=%d\n",abs(RL_LVDT),abs(RL_LVDT0)); 
-    pc.printf("RR_LVDT=%d, RR_LVDT0=%d\n",abs(RR_LVDT),abs(RR_LVDT0));    
+    //pc.printf("RL_LVDT=%d, RL_LVDT0=%d\n",abs(RL_LVDT),abs(RL_LVDT0)); 
+    //pc.printf("RR_LVDT=%d, RR_LVDT0=%d\n",abs(RR_LVDT),abs(RR_LVDT0));    
     
 };