mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[ion/device/bench] Add command to write and validate PCB version
This commit is contained in:
@@ -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 \
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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);
|
||||
|
||||
26
ion/src/device/bench/command/pcb_version.cpp
Normal file
26
ion/src/device/bench/command/pcb_version.cpp
Normal 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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user