From 9bd3e9b4dae73cbeb96aa276b5bab36e52dd9090 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Mon, 28 Aug 2023 09:09:54 +0200 Subject: [PATCH] implment re-write momory by CAN --- 306-controller_interface.X/app/can_message.c | 61 ++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/306-controller_interface.X/app/can_message.c b/306-controller_interface.X/app/can_message.c index 9030894..d8f3fe3 100644 --- a/306-controller_interface.X/app/can_message.c +++ b/306-controller_interface.X/app/can_message.c @@ -25,6 +25,67 @@ typedef union { void CM_processIncome(uint8_t idSender, uint8_t idMsg, uint32_t data){ switch(idSender){ case 0: // Broadcast / Debug + /* + S R M + 0 1 0 CONTROL_SETUP steeringMode - - controlAliveTime + 0 1 1 CONTROL_SPEED_FACTOR valHH valH valL valLL + 0 1 2 CONTROL_POWER_FACTOR valHH valH valL valLL + 0 1 3 CONTROL_STEERING_FACTOR valHH valH valL valLL + 0 1 4 CONTROL_SECURITY_PARAM maxSpeedFw maxSpeedBw - - + 0 1 5 CONTROL_SETUP_PARAM displayAliveTime steeringAliveTime + 0 1 6 CONTROL_SETUP_PARAM_JOY joystickMode joystickParam1 joystickParam2 joystickAliveTime + 0 1 7 CONTROL_SETUP_PARAM_DRIVE driveAliveTime driveSpeedTime driveStopTime + 0 1 8 CONTROL_SETUP_PARAM_BATTERY batteryVoltTime batteryCurrentTime batteryEnergyTime batteryAliveTime + */ + if(idMsg == 0x0) { // CONTROL_SETUP + + } + + if(idMsg == 0x1) { // CONTROL_SPEED_FACTOR + + } + + if(idMsg == 0x2) { // CONTROL_POWER_FACTOR + + } + + if(idMsg == 0x3) { // CONTROL_STEERING_FACTOR + + } + + if(idMsg == 0x4) { // CONTROL_SECURITY_PARAM + + } + + if(idMsg == 0x5) { // CONTROL_SETUP_PARAM + + } + + if(idMsg == 0x6) { // CONTROL_SETUP_PARAM_JOY + // joystickMode joystickParam1 joystickParam2 joystickAliveTime + BYTES_4 tmpData; + tmpData.full.bytes = data; + MEM_write_one_byte(MEMADD_JOYSTICK_MODE, tmpData.separate.byte0); + MEM_write_one_byte(MEMADD_JOYSTICK_PARAM1, tmpData.separate.byte1); + MEM_write_one_byte(MEMADD_JOYSTICK_PARAM2, tmpData.separate.byte2); + MEM_write_one_byte(MEMADD_JOYSTICK_ALIVE_TIME, tmpData.separate.byte3); + CAR_CST.JOYSTICK_MODE = MEM_read_one_byte(MEMADD_JOYSTICK_MODE); + CAR_CST.JOYSTICK_PARAM1 = MEM_read_one_byte(MEMADD_JOYSTICK_PARAM1); + CAR_CST.JOYSTICK_PARAM2 = MEM_read_one_byte(MEMADD_JOYSTICK_PARAM2); + CAR_CST.JOYSTICK_ALIVE_TIME = MEM_read_one_byte(MEMADD_JOYSTICK_ALIVE_TIME); + ALIVE_CHECKER_setAliveTime(ACjoy(), CAR_CST.JOYSTICK_ALIVE_TIME); + CM_JOY_SETUP(NULL); + + } + + if(idMsg == 0x7) { // CONTROL_SETUP_PARAM_DRIVE + + } + + if(idMsg == 0x8) { // CONTROL_SETUP_PARAM_BATTERY + + } + break; case 2: // Joystick