isolation support
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
#include "serial_control.h"
|
||||
#include "charger_gbt.h"
|
||||
#include "crc.h"
|
||||
#include "usart.h"
|
||||
#include "charger_control.h"
|
||||
#include "charger_gbt.h"
|
||||
@@ -11,6 +10,12 @@
|
||||
#ifdef USE_WEB_INTERFACE
|
||||
|
||||
extern uint8_t GBT_BAT_STAT_recv;
|
||||
extern volatile SC_Source_t g_sc_command_source;
|
||||
|
||||
IsolationStatusPacket_t ISO = {
|
||||
.isolationResistance = 0xFFFF
|
||||
};
|
||||
|
||||
|
||||
uint8_t config_initialized = 0;
|
||||
ConfigBlock_t config = {
|
||||
@@ -94,7 +99,20 @@ void SC_CommandHandler(ReceivedCommand_t* cmd) {
|
||||
// 3. Выполняем программный сброс
|
||||
NVIC_SystemReset();
|
||||
return; // Сюда код уже не дойдет, но для компилятора нужно
|
||||
|
||||
|
||||
case CMD_ISOLATION_STATUS:
|
||||
if (cmd->argument_length == sizeof(IsolationStatusPacket_t)) {
|
||||
memcpy(&ISO, cmd->argument, sizeof(IsolationStatusPacket_t));
|
||||
// Для однонаправленного UART5 ответ не нужен
|
||||
if (g_sc_command_source == SC_SOURCE_UART5) {
|
||||
return;
|
||||
}
|
||||
response_code = RESP_SUCCESS;
|
||||
break;
|
||||
}
|
||||
response_code = RESP_FAILED;
|
||||
break;
|
||||
|
||||
default:
|
||||
// Неизвестная команда
|
||||
response_code = RESP_FAILED;
|
||||
|
||||
Reference in New Issue
Block a user