mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-19 05:40:38 +01:00
[bench] USBPlugged command
This commit is contained in:
committed by
EmilieNumworks
parent
849b9009d2
commit
57ceda5ac0
@@ -27,5 +27,6 @@ ion_target_device_bench_src += $(addprefix ion/src/device/bench/command/, \
|
||||
sleep.cpp \
|
||||
stop.cpp \
|
||||
standby.cpp \
|
||||
usb_plugged.cpp \
|
||||
vblank.cpp \
|
||||
)
|
||||
|
||||
@@ -29,6 +29,7 @@ constexpr CommandHandler handles[] = {
|
||||
CommandHandler("SLEEP", Command::Sleep),
|
||||
CommandHandler("STOP", Command::Stop),
|
||||
CommandHandler("STANDBY", Command::Standby),
|
||||
CommandHandler("USB_PLUGGED", Command::USBPlugged),
|
||||
CommandHandler("VBLANK", Command::VBlank),
|
||||
CommandHandler(nullptr, nullptr)
|
||||
};
|
||||
|
||||
@@ -30,6 +30,7 @@ void ScreenID(const char * input);
|
||||
void Sleep(const char * input);
|
||||
void Stop(const char * input);
|
||||
void Standby(const char * input);
|
||||
void USBPlugged(const char * input);
|
||||
void VBlank(const char * input);
|
||||
|
||||
extern const char * const sOK;
|
||||
|
||||
24
ion/src/device/bench/command/usb_plugged.cpp
Normal file
24
ion/src/device/bench/command/usb_plugged.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#include "command.h"
|
||||
#include <ion/usb.h>
|
||||
|
||||
namespace Ion {
|
||||
namespace Device {
|
||||
namespace Bench {
|
||||
namespace Command {
|
||||
|
||||
void USBPlugged(const char * input) {
|
||||
if (input != nullptr) {
|
||||
reply(sSyntaxError);
|
||||
return;
|
||||
}
|
||||
if (Ion::USB::isPlugged()) {
|
||||
reply(sON);
|
||||
} else {
|
||||
reply(sOFF);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user