Add regen overcurrent limit
This commit is contained in:
		@ -28,9 +28,10 @@ void shunt_check() {
 | 
			
		||||
  if (HAL_GetTick() - shunt_data.last_message > SHUNT_TIMEOUT) {
 | 
			
		||||
    is_error = 1;
 | 
			
		||||
    can_send_error(TS_ERRORKIND_SHUNT_TIMEOUT, 0);
 | 
			
		||||
  } else if (shunt_data.current >= SHUNT_THRESH_OVERCURRENT) {
 | 
			
		||||
  } else if (shunt_data.current >= SHUNT_THRESH_OVERCURRENT ||
 | 
			
		||||
             shunt_data.current <= -SHUNT_THRESH_OVERCURRENT_REGEN) {
 | 
			
		||||
    is_error = 1;
 | 
			
		||||
    can_send_error(TS_ERRORKIND_SHUNT_OVERTEMP, 0);
 | 
			
		||||
    can_send_error(TS_ERRORKIND_SHUNT_OVERCURRENT, 0);
 | 
			
		||||
  } else if (shunt_data.busbartemp >= SHUNT_THRESH_OVERTEMP) {
 | 
			
		||||
    is_error = 1;
 | 
			
		||||
    can_send_error(TS_ERRORKIND_SHUNT_OVERTEMP, 0);
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user