From 6051e4b9933054d4150e5f6290bec7d889e8751b Mon Sep 17 00:00:00 2001 From: Oskar Date: Sun, 25 May 2025 14:55:18 +0200 Subject: [PATCH] Update mappings to newest agreements --- Software/Core/Inc/mappings.h | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/Software/Core/Inc/mappings.h b/Software/Core/Inc/mappings.h index 06978b7..7a5a872 100644 --- a/Software/Core/Inc/mappings.h +++ b/Software/Core/Inc/mappings.h @@ -2,8 +2,14 @@ #define MAPPINGS_H // CHOOSE ONE, comment the other or comment both and use -D SN_FRONT -#define SN_FRONT -//#define SN_REAR +//#define SN_FRONT +#define SN_REAR + +#ifdef SN_FRONT +#ifdef SN_REAR +#error "Choose to either #define SN_FRONT or SN_REAR, not both!" +#endif +#endif #include #include "main.h" @@ -95,10 +101,10 @@ typedef struct { static can_pkt_t CAN_SIGNAL_MAP[NUM_TX_PKT] = { { .can_id = 0x0D1, .dlc = 3, .num_signals = 7, .period = 100, .signals = { - { .type = DIN, .channel = R5, .start = 0, .length = 1, .factor = 1., .name = "LS L" }, - { .type = DIN, .channel = L9, .start = 1, .length = 1, .factor = 1., .name = "LS R" }, - { .type = DIN, .channel = LA, .start = 2, .length = 1, .factor = 1., .name = "SDC M pre BOTS" }, - { .type = DIN, .channel = LC, .start = 3, .length = 1, .factor = 1., .name = "SDC M post INS" }, + { .type = DIN, .channel = L9, .start = 0, .length = 1, .factor = 1., .name = "LS L" }, + { .type = DIN, .channel = LA, .start = 1, .length = 1, .factor = 1., .name = "LS R" }, + { .type = DIN, .channel = R5, .start = 2, .length = 1, .factor = 1., .name = "SDC M pre BOTS" }, + { .type = DIN, .channel = R6, .start = 3, .length = 1, .factor = 1., .name = "SDC M post INS" }, { .type = DIN, .channel = R7, .start = 4, .length = 1, .factor = 1., .name = "SDC M post BSPD" }, { .type = AIN, .channel = R0, .start = 8, .length = 8, .factor = ((512./2)/ADQ), .name = "BDTS FL" }, @@ -109,7 +115,7 @@ static can_pkt_t CAN_SIGNAL_MAP[NUM_TX_PKT] = { .can_id = 0x0D3, .dlc = 7, .num_signals = 6, .period = 10, .signals = { { .type = AIN, .channel = L1, .start = 0, .length = 8, .factor = (256./ADQ), .name = "APPS 1" }, { .type = AIN, .channel = L2, .start = 8, .length = 8, .factor = (256./ADQ), .name = "APPS 2" }, - { .type = AIN, .channel = RA, .start = 16, .length = 8, .factor = ((512./2)/ADQ), .name = "BP F" }, + { .type = AIN, .channel = L5, .start = 16, .length = 8, .factor = ((512./2)/ADQ), .name = "BP F" }, { .type = AIN, .channel = R9, .start = 24, .length = 12, .factor = 1., .name = "SAS" }, { .type = FIN, .channel = R8, .start = 40, .length = 8, .factor = 1., .name = "WSS FL" }, { .type = FIN, .channel = LB, .start = 48, .length = 8, .factor = 1., .name = "WSS FR" }, @@ -117,7 +123,7 @@ static can_pkt_t CAN_SIGNAL_MAP[NUM_TX_PKT] = { }, { .can_id = 0x0D5, .dlc = 3, .num_signals = 2, .period = 10, .signals = { - { .type = AIN, .channel = RC, .start = 0, .length = 12, .factor = 1., .name = "DS FL" }, + { .type = AIN, .channel = L3, .start = 0, .length = 12, .factor = 1., .name = "DS FL" }, { .type = AIN, .channel = L4, .start = 12, .length = 12, .factor = 1., .name = "DS FR" }, } }, @@ -148,20 +154,20 @@ static can_pkt_t CAN_SIGNAL_MAP[NUM_TX_PKT] = { { .type = AIN, .channel = R0, .start = 8, .length = 8, .factor = ((512./2)/ADQ), .name = "BDTS RL" }, { .type = AIN, .channel = L8, .start = 16, .length = 8, .factor = ((512./2)/ADQ), .name = "BDTS RR" }, - { .type = AIN, .channel = R9, .start = 24, .length = 8, .factor = (256./ADQ), .name = "WT BAT" }, - { .type = AIN, .channel = RB, .start = 32, .length = 8, .factor = (256./ADQ), .name = "WT DT" }, - { .type = AIN, .channel = RD, .start = 40, .length = 8, .factor = (256./ADQ), .name = "WP BAT" }, - { .type = AIN, .channel = RF, .start = 48, .length = 8, .factor = (256./ADQ), .name = "WP DT" }, + { .type = AIN, .channel = L3, .start = 24, .length = 8, .factor = (256./ADQ), .name = "WT BAT" }, + { .type = AIN, .channel = R9, .start = 32, .length = 8, .factor = (256./ADQ), .name = "WT DT" }, + { .type = AIN, .channel = L5, .start = 40, .length = 8, .factor = (256./ADQ), .name = "WP BAT" }, + { .type = AIN, .channel = RB, .start = 48, .length = 8, .factor = (256./ADQ), .name = "WP DT" }, } }, { .can_id = 0x0D4, .dlc = 8, .num_signals = 7, .period = 10, .signals = { { .type = AIN, .channel = L1, .start = 0, .length = 8, .factor = ((25.6/.1)/ADQ), .name = "EBS APS 1" }, { .type = AIN, .channel = L2, .start = 8, .length = 8, .factor = ((25.6/.1)/ADQ), .name = "EBS APS 2" }, - { .type = AIN, .channel = RA, .start = 16, .length = 8, .factor = ((512./2)/ADQ), .name = "BP F" }, + { .type = AIN, .channel = RA, .start = 16, .length = 8, .factor = ((512./2)/ADQ), .name = "BP R" }, { .type = FIN, .channel = R8, .start = 24, .length = 8, .factor = 1., .name = "WSS RL" }, { .type = FIN, .channel = LB, .start = 32, .length = 8, .factor = 1., .name = "WSS RR" }, - { .type = AIN, .channel = RC, .start = 40, .length = 12, .factor = 1., .name = "DS RL" }, + { .type = AIN, .channel = L7, .start = 40, .length = 12, .factor = 1., .name = "DS RL" }, { .type = AIN, .channel = L4, .start = 52, .length = 12, .factor = 1., .name = "DS RR" }, } },