Working rough indicator of power

This commit is contained in:
Ben V. Brown
2017-07-26 22:05:54 +10:00
parent 965a0890cb
commit af9b8dca29
4 changed files with 147 additions and 1 deletions

View File

@@ -473,7 +473,11 @@ void DrawUI() {
//Optionally draw the arrows, or draw the power instead
if (systemSettings.powerDisplay) {
//We want to draw in a neat little bar graph of power being pushed to the tip
//ofset 11
uint16_t count = getIronTimer() / (40000 / 28);
if (count > 28)
count = 28;
OLED_DrawWideChar((count), 6);
} else {
//Draw in the arrows if the user has the power display turned off
OLED_BlankSlot(6 * 12 + 16, 24 - 16);//blank out the tail after the arrows

View File

@@ -221,6 +221,14 @@ void OLED_DrawExtendedChar(uint8_t id, uint8_t x) {
Oled_DrawArea(x, 0, FONT_WIDTH, 16, (u8*) ptr);
}
void OLED_DrawWideChar(uint8_t id, uint8_t x) {
u8* ptr = (u8*) DoubleWidthChars;
ptr += (id) * (FONT_WIDTH * 4);
x *= FONT_WIDTH; //convert to a x coordinate
Oled_DrawArea(x, 0, FONT_WIDTH * 2, 16, (u8*) ptr);
}
void OLED_BlankSlot(uint8_t xStart, uint8_t width) {
u8* ptr = (u8*) FONT;
ptr += (36) * (FONT_WIDTH * 2);