11
Dependencies: mbed-dev-f303 FastPWM3
Diff: main.cpp
- Revision:
- 53:89565c1d9115
- Parent:
- 52:8fff6f1a3f50
- Child:
- 54:4ce8f97be6ae
--- a/main.cpp Mon Dec 20 01:24:06 2021 +0000 +++ b/main.cpp Mon Dec 27 02:47:12 2021 +0000 @@ -4,7 +4,7 @@ /// Written for the STM32F446, but can be implemented on other STM32 MCU's with some further register-diddling #define REST_MODE 0 -#define CALIBRATION_MODE 1./ +#define CALIBRATION_MODE 1 #define MOTOR_MODE 2 #define SETUP_MODE 4 #define ENCODER_MODE 5 @@ -85,7 +85,15 @@ } //************YZ ADD **********2021.11.05**************// 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))){ + /* + quanshu=spi.aa; + if (!prefs.ready()) prefs.open(); + prefs.flush(); // Write new prefs to flash + prefs.close(); + prefs.load(); + */ spi.ZeroPosition(); + } /* else if(state == MOTOR_MODE){ @@ -228,7 +236,7 @@ } break; - case CALIBRATION_MODE: // Run encoder calibration procedure + case CALIBRATION_MODE: // Run encoder calibration procedure if(state_change){ calibrate(); }