moved debugNumber into OLED class
This commit is contained in:
@@ -82,6 +82,7 @@ public:
|
||||
static void drawCheckbox(bool state) {
|
||||
drawSymbol((state) ? 16 : 17);
|
||||
}
|
||||
static void debugNumber(int32_t val);
|
||||
static void drawSymbol(uint8_t symbolID);//Used for drawing symbols of a predictable width
|
||||
static void drawArea(int16_t x, int8_t y, uint8_t wide, uint8_t height,
|
||||
const uint8_t* ptr); //Draw an area, but y must be aligned on 0/8 offset
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -90,20 +90,6 @@ int main(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void 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 printVoltage() {
|
||||
OLED::printNumber(getInputVoltageX10(systemSettings.voltageDiv) / 10, 2);
|
||||
OLED::drawChar('.');
|
||||
|
||||
Reference in New Issue
Block a user