Fork and fix for mwork
Dependencies: mbed-dev-f303 FastPWM3 millis
Diff: main.cpp
- Revision:
- 56:eaf75bcad361
- Parent:
- 55:fee62d8fd8fb
- Child:
- 57:c26b0093783b
--- a/main.cpp Fri Jun 26 01:26:53 2020 +0000 +++ b/main.cpp Fri Jun 26 02:20:22 2020 +0000 @@ -148,6 +148,14 @@ } // CAN message received +/* +FD REST_MODE +FC MOTORMODE +FE ZeroPosition +FB SteoDir +FA Serial +F0 Calib +*/ void onMsgReceived() { //msgAvailable = true; //0A FF FF FF FF FF //cond_printf("%df\n\r", rxMsg.id); @@ -161,7 +169,12 @@ else if(((rxMsg.data[0]==0xFF) & (rxMsg.data[1]==0xFF) & (rxMsg.data[2]==0xFF) & (rxMsg.data[3]==0xFF) * (rxMsg.data[4]==0xFF) & (rxMsg.data[5]==0xFF) & (rxMsg.data[6]==0xFF) & (rxMsg.data[7]==0xFD))){ state = REST_MODE; state_change = 1; - gpio.led->write(0);; + gpio.led->write(0); + } + else if(((rxMsg.data[0]==0xFF) & (rxMsg.data[1]==0xFF) & (rxMsg.data[2]==0xFF) & (rxMsg.data[3]==0xFF) * (rxMsg.data[4]==0xFF) & (rxMsg.data[5]==0xFF) & (rxMsg.data[6]==0xFF) & (rxMsg.data[7]==0xF0))){ + state = CALIBRATION_MODE; + state_change = 1; + //gpio.led->write(0); } else if(((rxMsg.data[0]==0xFF) & (rxMsg.data[1]==0xFF) & (rxMsg.data[2]==0xFF) & (rxMsg.data[3]==0xFF) * (rxMsg.data[4]==0xFF) & (rxMsg.data[5]==0xFF) & (rxMsg.data[6]==0xFF) & (rxMsg.data[7]==0xFE))){ spi.ZeroPosition();