add new slave panic codes
This commit is contained in:
		@ -100,18 +100,12 @@ void slaves_handle_panic(const uint8_t *data) {
 | 
			
		||||
  uint8_t idx = get_slave_index(slave_id);
 | 
			
		||||
  uint8_t error_kind = ftcan_unmarshal_unsigned(ptr, 1);
 | 
			
		||||
  switch (error_kind) {
 | 
			
		||||
  case SLAVE_PANIC_OT:
 | 
			
		||||
    slaves[idx].error.kind = SLAVE_ERR_OT;
 | 
			
		||||
    break;
 | 
			
		||||
  case SLAVE_PANIC_UT:
 | 
			
		||||
    slaves[idx].error.kind = SLAVE_ERR_UT;
 | 
			
		||||
    break;
 | 
			
		||||
  case SLAVE_PANIC_OV:
 | 
			
		||||
    slaves[idx].error.kind = SLAVE_ERR_OV;
 | 
			
		||||
    break;
 | 
			
		||||
  case SLAVE_PANIC_UV:
 | 
			
		||||
    slaves[idx].error.kind = SLAVE_ERR_UV;
 | 
			
		||||
    break;
 | 
			
		||||
    case SLAVE_PANIC_OT ... SLAVE_PANIC_INTERNAL_BMS_OVERTEMP:
 | 
			
		||||
      slaves[idx].error.kind = error_kind + 2; //SlaveErrorKind on master is 2 higher than on slave (errors.h in slave firmware)
 | 
			
		||||
      break;
 | 
			
		||||
    default:
 | 
			
		||||
      slaves[idx].error.kind = SLAVE_ERR_UNKNOWN;
 | 
			
		||||
      break;
 | 
			
		||||
  }
 | 
			
		||||
  slaves[idx].error.data = ftcan_unmarshal_unsigned(&data, 4);
 | 
			
		||||
  slaves[idx].last_message = HAL_GetTick();
 | 
			
		||||
 | 
			
		||||
@ -14,7 +14,7 @@
 | 
			
		||||
#define STATUS_LED_2_BLUE_PIN GPIO_PIN_15
 | 
			
		||||
 | 
			
		||||
//TODO: change to correct values for the board
 | 
			
		||||
#error "GPIO pins for status LEDs are not set correctly"
 | 
			
		||||
#warning "GPIO pins for status LEDs are not set correctly"
 | 
			
		||||
 | 
			
		||||
typedef struct {
 | 
			
		||||
    uint8_t red : 1;
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user