Rename (Dcdc|PwmSwitch)::emergency_stop to stop

The stop functions can be used in a generic way, not only in an emergency
situation. The name was misleading.
This commit is contained in:
Martin Jäger
2020-11-05 20:36:51 +01:00
parent 75e2969274
commit c6709f8f00
5 changed files with 16 additions and 13 deletions
+2 -2
View File
@@ -253,10 +253,10 @@ void high_voltage_alert()
{
// disable any sort of input
#if DT_NODE_EXISTS(DT_PATH(dcdc))
dcdc.emergency_stop();
dcdc.stop();
#endif
#if DT_NODE_EXISTS(DT_CHILD(DT_PATH(outputs), pwm_switch))
pwm_switch.emergency_stop();
pwm_switch.stop();
#endif
// do not use enter_state function, as we don't want to wait entire recharge delay
charger.state = CHG_STATE_IDLE;
+2 -4
View File
@@ -270,9 +270,7 @@ __weak void Dcdc::control()
}
if (stop_reason != NULL) {
half_bridge_stop();
state = DCDC_CONTROL_OFF;
off_timestamp = uptime();
stop();
printf("DC/DC Stop: %s.\n", stop_reason);
}
}
@@ -306,7 +304,7 @@ void Dcdc::test()
}
}
void Dcdc::emergency_stop()
void Dcdc::stop()
{
half_bridge_stop();
state = DCDC_CONTROL_OFF;
+5 -3
View File
@@ -113,11 +113,13 @@ public:
void test();
/**
* Fast emergency stop function
* Fast stop function (bypassing control loop)
*
* May be called from an ISR which detected overvoltage / overcurrent conditions
* May be called from an ISR which detected overvoltage / overcurrent conditions.
*
* DC/DC will be restarted automatically from control function if condtions are valid.
*/
void emergency_stop();
void stop();
/**
* Prevent overcharging of battery in case of shorted HS MOSFET
+1 -1
View File
@@ -132,7 +132,7 @@ void PwmSwitch::control()
}
}
void PwmSwitch::emergency_stop()
void PwmSwitch::stop()
{
pwm_signal_stop();
off_timestamp = uptime();
+6 -3
View File
@@ -38,11 +38,14 @@ public:
*/
void test();
/** Fast emergency stop function
/**
* Fast stop function (bypassing control loop)
*
* May be called from an ISR which detected overvoltage / overcurrent conditions
* May be called from an ISR which detected overvoltage / overcurrent conditions.
*
* PWM port will be restarted automatically from control function if condtions are valid.
*/
void emergency_stop();
void stop();
/** Read the general on/off status of PWM switching
*