1
0
forked from me/IronOS
* Ability to print hex

* Add device ID getter

* Refactor debug menu

* No longer need patch

* Update make_translation.py

* Fix typo

* Fix hex drawing
This commit is contained in:
Ben V. Brown
2022-06-16 21:39:53 +10:00
committed by GitHub
parent 165a9952c2
commit 078b8f5626
12 changed files with 104 additions and 38 deletions

View File

@@ -423,6 +423,13 @@ inline void stripLeaderZeros(char *buffer, uint8_t places) {
}
}
}
void OLED::drawHex(uint32_t x, FontStyle fontStyle) {
// print number to hex
for (uint_fast8_t i = 0; i < 8; i++) {
uint16_t value = (x >> (4 * (7 - i))) & 0b1111;
drawChar(value + 2, fontStyle);
}
}
// maximum places is 5
void OLED::printNumber(uint16_t number, uint8_t places, FontStyle fontStyle, bool noLeaderZeros) {
char buffer[7] = {0};