mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
DrawHex dynamicLength
This commit is contained in:
@@ -423,9 +423,9 @@ inline void stripLeaderZeros(char *buffer, uint8_t places) {
|
||||
}
|
||||
}
|
||||
}
|
||||
void OLED::drawHex(uint32_t x, FontStyle fontStyle) {
|
||||
void OLED::drawHex(uint32_t x, FontStyle fontStyle, uint8_t digits) {
|
||||
// print number to hex
|
||||
for (uint_fast8_t i = 0; i < 8; i++) {
|
||||
for (uint_fast8_t i = 0; i < digits; i++) {
|
||||
uint16_t value = (x >> (4 * (7 - i))) & 0b1111;
|
||||
drawChar(value + 2, fontStyle);
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ public:
|
||||
// Draws a checkbox
|
||||
static void drawCheckbox(bool state) { drawSymbol((state) ? 16 : 17); }
|
||||
static void debugNumber(int32_t val, FontStyle fontStyle);
|
||||
static void drawHex(uint32_t x, FontStyle fontStyle);
|
||||
static void drawHex(uint32_t x, FontStyle fontStyle, uint8_t digits);
|
||||
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
|
||||
static void drawAreaSwapped(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
|
||||
|
||||
@@ -758,8 +758,10 @@ void showDebugMenu(void) {
|
||||
// Print device ID Numbers
|
||||
{
|
||||
uint64_t id = getDeviceID();
|
||||
OLED::drawHex((uint32_t)(id >> 32), FontStyle::SMALL);
|
||||
OLED::drawHex((uint32_t)(id & 0xFFFFFFFF), FontStyle::SMALL);
|
||||
OLED::drawHex((uint32_t)(id >> 32), FontStyle::SMALL, 2);
|
||||
|
||||
OLED::drawHex((uint32_t)(id >> 32), FontStyle::SMALL, 8);
|
||||
OLED::drawHex((uint32_t)(id & 0xFFFFFFFF), FontStyle::SMALL, 8);
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
|
||||
Reference in New Issue
Block a user