1
0
forked from me/IronOS

moved debugNumber into OLED class

This commit is contained in:
David P Hilton
2018-10-28 21:51:49 -06:00
parent 76b460cd77
commit 6a3ca96815
3 changed files with 16 additions and 14 deletions

View File

@@ -7,6 +7,7 @@
#include <string.h>
#include <OLED.hpp>
#include <stdlib.h>
#include "Translation.h"
#include "cmsis_os.h"
@@ -231,6 +232,20 @@ void OLED::printNumber(uint16_t number, uint8_t places) {
print(buffer);
}
void OLED::debugNumber(int32_t val) {
if (abs(val) > 99999) {
OLED::print(" OoB"); // out of bounds
return;
}
if (val >= 0) {
OLED::drawChar(' ');
OLED::printNumber(val, 5);
} else {
OLED::drawChar('-');
OLED::printNumber(-val, 5);
}
}
void OLED::drawSymbol(uint8_t symbolID) {
// draw a symbol to the current cursor location
setFont(2);