[ion/device] Add a SUSPEND commant to the test bench

Change-Id: Ie6c3a48e70e756b2c8a90df749375080b9fdb2dd
This commit is contained in:
Romain Goyet
2017-05-07 12:09:48 +02:00
parent 3c3981e0e4
commit 02c6ecf94b
4 changed files with 25 additions and 0 deletions

View File

@@ -15,4 +15,5 @@ objs += $(addprefix ion/src/device/bench/command/, \
led.o \
mcu_serial.o \
ping.o \
suspend.o \
)

View File

@@ -16,6 +16,7 @@ constexpr CommandHandler handles[] = {
CommandHandler("LED", Command::LED),
CommandHandler("MCU_SERIAL", Command::MCUSerial),
CommandHandler("PING", Command::Ping),
CommandHandler("SUSPEND", Command::Suspend),
CommandHandler(nullptr, nullptr)
};

View File

@@ -19,6 +19,7 @@ void Keyboard(const char * input);
void LED(const char * input);
void MCUSerial(const char * input);
void Ping(const char * input);
void Suspend(const char * input);
extern const char * const sOK;
extern const char * const sKO;

View File

@@ -0,0 +1,22 @@
#include "command.h"
#include <ion.h>
namespace Ion {
namespace Device {
namespace Bench {
namespace Command {
void Suspend(const char * input) {
if (input != nullptr) {
reply(sSyntaxError);
return;
}
reply(sOK);
Ion::msleep(500);
Ion::Power::suspend();
}
}
}
}
}