diff --git a/306-controller_interface.X/app/can_message.c b/306-controller_interface.X/app/can_message.c index 2e5cca0..d8d9a97 100644 --- a/306-controller_interface.X/app/can_message.c +++ b/306-controller_interface.X/app/can_message.c @@ -30,9 +30,12 @@ void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ *********************/ case 0: if(idMsg == 0x0) { // CONTROL_SETUP - // steeringMode - - controlAliveTime + // steeringMode eraseMemory - controlAliveTime BYTES_4 tmpData; tmpData.full.bytes = data; + if (tmpData.separate.byte1) { + MEM_reset(); + } CAR_CST.CONTROL_STEERING_MODE = tmpData.separate.byte0; CAR_CST.CONTROL_ALIVE_TIME = tmpData.separate.byte3; MEM_write_1_byte(MEMADD_CONTROL_STEERING_MODE, CAR_CST.CONTROL_STEERING_MODE); diff --git a/threewheeler.DBF b/threewheeler.DBF index 727ded4..b2261ba 100644 --- a/threewheeler.DBF +++ b/threewheeler.DBF @@ -38,10 +38,11 @@ [VALUE_DESCRIPTION] RACE,2 [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, [VALUE_DESCRIPTION] No alive message,0 [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] [START_MSG] CONTROL_SPEED_FACTOR,17,4,1,1,S