can_main

Dependencies:   mbed CanMsga

Files at this revision

API Documentation at this revision

Comitter:
kurobikari
Date:
Fri Sep 03 00:38:30 2021 +0000
Parent:
2:2ee241819861
Commit message:
new

Changed in this revision

can.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/can.cpp	Wed Sep 01 07:01:56 2021 +0000
+++ b/can.cpp	Fri Sep 03 00:38:30 2021 +0000
@@ -50,13 +50,13 @@
 
     /*  idを設定  */
     txMsg[ConNumber/2].id = ConNumber/2+CAN_TX_ADDRESS;
+    
+    /*   データセット  PWMを各配列に代入  */
+    txMsg[ConNumber/2].data[ConNumber%2+1] =(char) PWM;
 
     /*  マイナスならフラグ立てる  */
     if(val<0)
         txMsg[ConNumber/2].data[ConNumber%2+1] |= (1<<7);
-
-    /*   データセット  PWMを各配列に代入  */
-    txMsg[ConNumber/2].data[ConNumber%2+1] |=(char) PWM;
 }
 
 int16_t YKNCT_MD_CAN::Get_enc(int8_t ConNumber)