Numworks Epsilon
1.4.1
Graphing Calculator Operating System
print.cpp
Go to the documentation of this file.
1
#include "
command.h
"
2
#include <
ion.h
>
3
#include <
ion/src/device/led.h
>
4
#include <
kandinsky.h
>
5
6
namespace
Ion
{
7
namespace
Device {
8
namespace
Bench {
9
namespace
Command
{
10
11
// Input must be of the form "XX,YY,STRING"
12
void
Print
(
const
char
* input) {
13
if
(input ==
nullptr
|| !
isHex
(input[0]) || !
isHex
(input[1]) || input[2] !=
','
|| !
isHex
(input[3]) || !
isHex
(input[4]) || input[5] !=
','
) {
14
reply
(
sKO
);
15
return
;
16
}
17
18
char
x =
hexNumber
(input, 2);
19
char
y =
hexNumber
(input+3, 2);
20
21
KDContext
* ctx =
KDIonContext::sharedContext
();
22
ctx->
drawString
(input+6,
KDPoint
(x, y));
23
24
reply
(
sOK
);
25
}
26
27
}
28
}
29
}
30
}
Ion::Device::Bench::Command::sOK
const char *const sOK
Definition:
command.cpp:9
command.h
ion.h
KDContext::drawString
KDPoint drawString(const char *text, KDPoint p, KDText::FontSize size=KDText::FontSize::Large, KDColor textColor=KDColorBlack, KDColor backgroundColor=KDColorWhite, int maxLength=-1)
Definition:
context_text.cpp:9
KDPoint
Definition:
point.h:6
Ion::Display::Device::Command
Command
Definition:
display.h:63
KDIonContext::sharedContext
static KDIonContext * sharedContext()
Definition:
ion_context.cpp:4
KDContext
Definition:
context.h:8
Ion::Device::Bench::Command::sKO
const char *const sKO
Definition:
command.cpp:10
Ion::Device::Bench::Command::hexNumber
uint32_t hexNumber(const char *s, int maxLength)
Definition:
command.cpp:33
Ion::Device::Bench::Command::Print
void Print(const char *input)
Definition:
print.cpp:12
led.h
Ion::Device::Bench::Command::reply
void reply(const char *s)
Definition:
command.cpp:15
Ion::Device::Bench::Command::isHex
bool isHex(char c)
Definition:
command.cpp:29
Ion
Definition:
backlight.h:6
kandinsky.h
epsilon
ion
src
device
bench
command
print.cpp
Generated by
1.8.14