[ion/device/bench] Add command to write and validate PCB version

This commit is contained in:
Gabriel Ozouf
2021-03-12 15:23:16 +01:00
committed by Gabriel
parent ddae6607f9
commit 8705ddaf8a
4 changed files with 29 additions and 0 deletions

View File

@@ -21,6 +21,7 @@ ion_device_bench_src += $(addprefix ion/src/device/bench/command/, \
lcd_timing.o \
led.cpp \
mcu_serial.cpp \
pcb_version.cpp \
ping.cpp \
print.cpp \
screen_id.cpp \

View File

@@ -23,6 +23,7 @@ constexpr CommandHandler handles[] = {
CommandHandler("LCD_TIMING", Command::LCDTiming),
CommandHandler("LED", Command::LED),
CommandHandler("MCU_SERIAL", Command::MCUSerial),
CommandHandler("PCB_VERSION", Command::PCBVersion),
CommandHandler("PING", Command::Ping),
CommandHandler("PRINT", Command::Print),
CommandHandler("SCREEN_ID", Command::ScreenID),

View File

@@ -24,6 +24,7 @@ void LCDPins(const char * input);
void LCDTiming(const char * input);
void LED(const char * input);
void MCUSerial(const char * input);
void PCBVersion(const char * input);
void Ping(const char * input);
void Print(const char * input);
void ScreenID(const char * input);

View File

@@ -0,0 +1,26 @@
#include "command.h"
#include <drivers/board.h>
namespace Ion {
namespace Device {
namespace Bench {
namespace Command {
void PCBVersion(const char * input) {
if (input != nullptr) {
reply(sSyntaxError);
return;
}
Board::writePCBVersion(PCB_LATEST);
if (Board::readPCBVersion() != PCB_LATEST) {
reply(sKO);
return;
}
reply(sOK);
}
}
}
}
}