forked from achamaikin/CCSModuleSW30Web
Remove FAKE_500V Everest workaround; use real setpoints on the bus (v1.0.24).
This commit is contained in:
+3
-18
@@ -47,7 +47,6 @@ static uint8_t enabled = 0;
|
||||
static uint8_t pwm_duty_percent = 100;
|
||||
uint8_t isolation_enable = 0;
|
||||
static uint32_t last_host_seen = 0;
|
||||
static uint8_t fake_500_voltage_mode = 0;
|
||||
static uint8_t everest_timed_out = 0;
|
||||
static uint8_t everest_timeout_warn_latched = 0;
|
||||
static uint8_t everest_timeout_stop_latched = 0;
|
||||
@@ -454,9 +453,6 @@ static void send_state(void) {
|
||||
CCS_State.DutyCycle = CP_GetDuty();
|
||||
CCS_State.OutputEnabled = PSU0.CONT_enabled;
|
||||
CCS_State.MeasuredVoltage = (uint16_t)CONN.MeasuredVoltage;
|
||||
if (fake_500_voltage_mode) {
|
||||
CCS_State.MeasuredVoltage = FAKE_EVREQ_VOLTAGE_V;
|
||||
}
|
||||
CCS_State.MeasuredCurrent = (uint16_t)CONN.MeasuredCurrent;
|
||||
CCS_State.Power = CCS_Power;
|
||||
CCS_State.Energy = CCS_Energy;
|
||||
@@ -534,20 +530,9 @@ ISR_FAST static void apply_command(uint8_t cmd, const uint8_t* payload, uint16_t
|
||||
}
|
||||
case CMD_E2M_SET_OUTPUT_VOLTAGE: {
|
||||
const e2m_set_output_t* p = (const e2m_set_output_t*)payload;
|
||||
uint16_t psu_voltage_V;
|
||||
uint16_t psu_current_0p1A;
|
||||
if (p->voltage_V == FAKE_EVREQ_VOLTAGE_V) {
|
||||
fake_500_voltage_mode = 1u;
|
||||
psu_voltage_V = FAKE_PSU_VOLTAGE_V;
|
||||
psu_current_0p1A = FAKE_PSU_CURRENT_0P1A;
|
||||
} else {
|
||||
fake_500_voltage_mode = 0u;
|
||||
psu_voltage_V = p->voltage_V;
|
||||
psu_current_0p1A = p->current_0p1A;
|
||||
}
|
||||
CONN.RequestedVoltage = psu_voltage_V;
|
||||
CONN.WantedCurrent = psu_current_0p1A;
|
||||
PowerSetpoint_OnCommand(psu_voltage_V, psu_current_0p1A);
|
||||
CONN.RequestedVoltage = p->voltage_V;
|
||||
CONN.WantedCurrent = p->current_0p1A;
|
||||
PowerSetpoint_OnCommand(p->voltage_V, p->current_0p1A);
|
||||
break;
|
||||
}
|
||||
case CMD_E2M_ISOLATION_CONTROL: {
|
||||
|
||||
Reference in New Issue
Block a user