diff --git a/hardware.cpp b/hardware.cpp index eefde52..0823f30 100644 --- a/hardware.cpp +++ b/hardware.cpp @@ -30,8 +30,6 @@ bool hardware_reset() { digitalWrite(TFT_BACKLIGHT, HIGH); #endif utft.InitLCD(); - extern uint8_t SmallFont[]; - utft.setFont(SmallFont); _cpu->reset(); return sd; diff --git a/keyboard.h b/keyboard.h index 38f9fe6..1c62131 100644 --- a/keyboard.h +++ b/keyboard.h @@ -6,6 +6,13 @@ public: virtual void up(byte) = 0; virtual void down(byte) = 0; virtual void reset() = 0; + + inline bool isshift(byte scan) { + return scan == 0x12 || scan == 0x59; + } + inline bool isctrl(byte scan) { + return scan == 0x14; + } }; #endif diff --git a/utftdisplay.cpp b/utftdisplay.cpp index 077d729..e6dc4bb 100644 --- a/utftdisplay.cpp +++ b/utftdisplay.cpp @@ -5,11 +5,14 @@ extern UTFT utft; -void UTFTDisplay::begin(unsigned bg, unsigned fg) { +void UTFTDisplay::begin(unsigned bg, unsigned fg, uint8_t *font) { _bg = bg; _fg = fg; _dx = utft.getDisplayXSize(); _dy = utft.getDisplayYSize(); + + utft.setFont(font); + utft.setColor(fg); _cx = utft.getFontXsize(); _cy = utft.getFontYsize(); _oxs = _dx; diff --git a/utftdisplay.h b/utftdisplay.h index 9a8e541..1029607 100644 --- a/utftdisplay.h +++ b/utftdisplay.h @@ -2,10 +2,11 @@ #define __UTFT_DISPLAY_H__ class Stream; +extern uint8_t SmallFont[]; class UTFTDisplay: public Memory::Device { public: - void begin(unsigned bg, unsigned fg); + void begin(unsigned bg, unsigned fg, uint8_t *font = SmallFont); void clear(); void error(char *); void status(const char *);