add reset memory by can

This commit is contained in:
Rémi Heredero 2023-08-29 16:28:12 +02:00
parent 72a307654f
commit debececcfd
2 changed files with 6 additions and 2 deletions

View File

@ -30,9 +30,12 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){
*********************/ *********************/
case 0: case 0:
if(idMsg == 0x0) { // CONTROL_SETUP if(idMsg == 0x0) { // CONTROL_SETUP
// steeringMode - - controlAliveTime // steeringMode eraseMemory - controlAliveTime
BYTES_4 tmpData; BYTES_4 tmpData;
tmpData.full.bytes = data; tmpData.full.bytes = data;
if (tmpData.separate.byte1) {
MEM_reset();
}
CAR_CST.CONTROL_STEERING_MODE = tmpData.separate.byte0; CAR_CST.CONTROL_STEERING_MODE = tmpData.separate.byte0;
CAR_CST.CONTROL_ALIVE_TIME = tmpData.separate.byte3; CAR_CST.CONTROL_ALIVE_TIME = tmpData.separate.byte3;
MEM_write_1_byte(MEMADD_CONTROL_STEERING_MODE, CAR_CST.CONTROL_STEERING_MODE); MEM_write_1_byte(MEMADD_CONTROL_STEERING_MODE, CAR_CST.CONTROL_STEERING_MODE);

View File

@ -38,10 +38,11 @@
[VALUE_DESCRIPTION] RACE,2 [VALUE_DESCRIPTION] RACE,2
[END_MSG] [END_MSG]
[START_MSG] CONTROL_SETUP,16,4,2,1,S [START_MSG] CONTROL_SETUP,16,4,3,1,S
[START_SIGNALS] AliveTime,8,4,0,U,255,0,1,0.000000,10.000000,mS, [START_SIGNALS] AliveTime,8,4,0,U,255,0,1,0.000000,10.000000,mS,
[VALUE_DESCRIPTION] No alive message,0 [VALUE_DESCRIPTION] No alive message,0
[START_SIGNALS] STEERING_MODE,1,1,0,B,1,0,1,0.000000,1.000000,, [START_SIGNALS] STEERING_MODE,1,1,0,B,1,0,1,0.000000,1.000000,,
[START_SIGNALS] ERASE_MEMORY,1,2,0,B,1,0,1,0.000000,1.000000,,
[END_MSG] [END_MSG]
[START_MSG] CONTROL_SPEED_FACTOR,17,4,1,1,S [START_MSG] CONTROL_SPEED_FACTOR,17,4,1,1,S