Add PSU fast discharge API for DC precharge step-down (v1.0.23).

Policy/executor hooks, event-driven OFF/ON state machine, and release binaries.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
raduet
2026-06-30 16:28:25 +02:00
co-authored by Cursor
parent ecf8e3d2f0
commit a583e12132
13 changed files with 7916 additions and 7128 deletions
+10 -4
View File
@@ -7,6 +7,7 @@
#include "debug.h"
#include "isr_opt.h"
#include "psu_control.h"
#include "power_setpoint_executor.h"
#include "serial_control.h"
#include <stdint.h>
#include <string.h>
@@ -533,15 +534,20 @@ 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;
CONN.RequestedVoltage = FAKE_PSU_VOLTAGE_V;
CONN.WantedCurrent = FAKE_PSU_CURRENT_0P1A;
psu_voltage_V = FAKE_PSU_VOLTAGE_V;
psu_current_0p1A = FAKE_PSU_CURRENT_0P1A;
} else {
fake_500_voltage_mode = 0u;
CONN.RequestedVoltage = p->voltage_V;
CONN.WantedCurrent = p->current_0p1A;
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);
break;
}
case CMD_E2M_ISOLATION_CONTROL: {