Numworks Epsilon  1.4.1
Graphing Calculator Operating System
bench.cpp
Go to the documentation of this file.
1 #include "bench.h"
2 #include <ion.h>
3 #include "command_list.h"
4 
5 namespace Ion {
6 namespace Device {
7 namespace Bench {
8 
9 constexpr CommandHandler handles[] = {
11  CommandHandler("BACKLIGHT", Command::Backlight),
13  CommandHandler("DISPLAY", Command::Display),
15  CommandHandler("KEYBOARD", Command::Keyboard),
17  CommandHandler("MCU_SERIAL", Command::MCUSerial),
20  CommandHandler("SUSPEND", Command::Suspend),
21  CommandHandler(nullptr, nullptr)
22 };
23 
25 
26 constexpr int kMaxCommandLength = 255;
27 
28 void run() {
30  char command[kMaxCommandLength];
31  while (true) {
33  const CommandHandler * ch = sCommandList.dispatch(command);
34  if (ch != nullptr && ch->function() == Command::Exit) {
35  break;
36  }
37  }
38 }
39 
40 }
41 }
42 }
constexpr const CommandList sCommandList
Definition: bench.cpp:24
const CommandHandler * dispatch(const char *command) const
Definition: command_list.cpp:8
constexpr int Width
Definition: display.h:26
void Display(const char *input)
Definition: display.cpp:11
void Backlight(const char *input)
Definition: backlight.cpp:10
void Charge(const char *input)
Definition: charge.cpp:9
void Ping(const char *input)
Definition: ping.cpp:8
void ADC(const char *input)
Definition: adc.cpp:11
constexpr CommandHandler handles[]
Definition: bench.cpp:9
void readLine(char *line, int maxLineLength)
constexpr KDColor KDColorWhite
Definition: color.h:42
void LED(const char *input)
Definition: led.cpp:11
void Suspend(const char *input)
Definition: suspend.cpp:9
void Print(const char *input)
Definition: print.cpp:12
constexpr int kMaxCommandLength
Definition: bench.cpp:26
void Exit(const char *input)
Definition: exit.cpp:8
Definition: rect.h:26
Command::Function function() const
void MCUSerial(const char *input)
Definition: mcu_serial.cpp:9
void Keyboard(const char *input)
Definition: keyboard.cpp:9
Definition: backlight.h:6
void pushRectUniform(KDRect r, KDColor c)
Definition: display.cpp:20
constexpr int Height
Definition: display.h:27