can_main

Dependencies:   mbed CanMsga

Revision:
3:b3cc1eb9fd5c
Parent:
2:2ee241819861
diff -r 2ee241819861 -r b3cc1eb9fd5c can.cpp
--- 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)