forked from achamaikin/CCSModuleSW30Web
Add fire alarm handling for DC30 CCS main controller.
Latch fire alarm until reboot, block recovery commands, and send periodic Everest ESTOP while active. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "board.h"
|
||||
#include "psu_control.h"
|
||||
#include "debug.h"
|
||||
#include "fire_alarm.h"
|
||||
#include <string.h>
|
||||
|
||||
#ifdef USE_WEB_INTERFACE
|
||||
@@ -27,6 +28,11 @@ void SC_CommandHandler(ReceivedCommand_t* cmd) {
|
||||
|
||||
uint8_t response_code = RESP_FAILED;
|
||||
|
||||
if (FireAlarm_IsBlockingCommand(cmd->command)) {
|
||||
SC_SendPacket(NULL, 0, RESP_FAILED);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (cmd->command) {
|
||||
// Команды БЕЗ аргументов
|
||||
case CMD_GET_STATUS:
|
||||
@@ -86,6 +92,11 @@ void SC_CommandHandler(ReceivedCommand_t* cmd) {
|
||||
// }
|
||||
response_code = RESP_FAILED;
|
||||
break;
|
||||
case CMD_FIRE_ALARM:
|
||||
FireAlarm_Activate();
|
||||
response_code = RESP_SUCCESS;
|
||||
break;
|
||||
|
||||
case CMD_DEVICE_RESET:
|
||||
// 2. Отправляем SUCCESS (хост может успеть получить его перед ребутом)
|
||||
SC_SendPacket(NULL, 0, RESP_SUCCESS);
|
||||
|
||||
Reference in New Issue
Block a user