diff --git a/Autogen/CAN/Doc/GRCAN.CANdo b/Autogen/CAN/Doc/GRCAN.CANdo index a9dd6c3be..6ec1f4013 100644 --- a/Autogen/CAN/Doc/GRCAN.CANdo +++ b/Autogen/CAN/Doc/GRCAN.CANdo @@ -3519,7 +3519,7 @@ Message ID: Dash Config: MSG ID: 0x01B MSG LENGTH: 1 - BMS LED: + led_bits: bit_start: 0 comment: LED command (0: off, 1: on) data type: b @@ -3537,29 +3537,10 @@ Message ID: TCM Status: MSG ID: 0x029 MSG LENGTH: 8 - Connection Status: + status_bits: bit_start: 0 - comment: 1: OK, 0: Timeout - data type: b - units: Bool - MQTT Status: - bit_start: 1 - comment: 1: OK, 0: Timeout - data type: b - units: Bool - Epic Shelter Status: - bit_start: 2 - comment: 1: In Progress, 0: Idle - data type: b - units: Bool - Camera Status: - bit_start: 3 - comment: 1: Recording, 0: Idle - data type: b - units: Bool - Reserved: - bit_start: 4-7 - Ping: + comment: "Connection Status = bit 0, MQTT Status = bit 1, Epic Shelter Status = bit 2, Camera Status = bit 3, bits 4-7 reserved" + Mapache Ping: bit_start: 8 comment: Mapache ping (upload) data type: u16 @@ -3685,28 +3666,6 @@ Message ID: comment: power draw in mW data type: u16 units: Celsius - Dash Warning Flags: - MSG ID: 0x02B - MSG LENGTH: 1 - BSE APPS Violation: - bit_start: 0 - comment: 1: Violation, 0: OK - data type: b - units: Bool - Reserved: - bit_start: 1 - Reserved: - bit_start: 2 - Reserved: - bit_start: 3 - Reserved: - bit_start: 4 - Reserved: - bit_start: 5 - Reserved: - bit_start: 6 - Reserved: - bit_start: 7 Specific Brake IR: MSG ID: 0x02C MSG LENGTH: 2 diff --git a/Autogen/CAN/Src/STRUCTparser.pl b/Autogen/CAN/Src/STRUCTparser.pl index 59268493a..0691f4a96 100644 --- a/Autogen/CAN/Src/STRUCTparser.pl +++ b/Autogen/CAN/Src/STRUCTparser.pl @@ -262,7 +262,7 @@ sub process_byte_entry { my $b_idx = ${$sorted_ref}[ ${$idx_ref} ]; my $fields = ${$map_ref}{$b_idx}; - if ( scalar @{$fields} > 2 && ${$fields}[0]->{name} =~ /reserved|ping|byte/ismx ) { + if ( scalar @{$fields} > 2 ) { push @out, handle_multi_field_range( $sorted_ref, $map_ref, $idx_ref ); } else { @@ -301,8 +301,9 @@ sub handle_multi_field_range { } } - my $len = ( ${$bytes_ref}[ ${$idx_ref} ] - $start_byte ) + 1; - my $v_name = $has_error ? 'error_fault_violation_bits' : 'ping_block'; - my $suffix = ( $len > 1 ) ? "[$len]" : $EMPTY_STR; - return sprintf "\tuint8_t %s%s;\n", $v_name, $suffix; + my $len = ( ${$bytes_ref}[ ${$idx_ref} ] - $start_byte ) + 1; + my $base = $has_error ? 'error_fault_violation_bits' : 'ping_block'; + my $identifier = $base . '_b' . $start_byte; + my $suffix = ( $len > 1 ) ? "[$len]" : $EMPTY_STR; + return sprintf "\tuint8_t %s%s;\n", $identifier, $suffix; }