moved debugNumber into OLED class
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user