moved main display draw to function

rtc
g7uhn 2020-12-30 07:27:03 +00:00
rodzic 1620041000
commit 0102d54cf3
1 zmienionych plików z 27 dodań i 17 usunięć

Wyświetl plik

@ -79,6 +79,7 @@ bool softkeyStatus[6] = {0, 0, 0, 0, 0, 0};
// Forward declaration of functions (required for PlatformIO)
// If you create your own user functions below, you'll need to declare them here for PlatformIO to compile
void drawMainDisplay(); // draw main display
void displayABCkeys(); // EEPROM read
void displaySoftKeyStatus(); // possible EEPROM reads
void getReadableMode(); // standard CAT command
@ -219,24 +220,9 @@ void setup(void)
TIMSK1 |= (1 << OCIE1A); // enable timer compare interrupt
sei(); // allow interrupts
// Initial display setup
display.drawFastVLine(41, 0, 10, BLACK);
display.drawFastVLine(24, 10, 21, BLACK);
display.drawFastVLine(59, 10, 21, BLACK);
display.drawFastHLine(0, 9, display.width(), BLACK);
display.drawFastHLine(0, 20, 24, BLACK);
display.drawFastHLine(60, 20, 24, BLACK);
display.drawFastHLine(0, 30, 24, BLACK);
display.drawFastHLine(60, 30, 24, BLACK);
// Display the soft keys by calling changePage()
changePage();
// Update the ABC keys
displayABCkeys();
// write to display
display.display();
// Initial display drawing
drawMainDisplay();
} // end setup
@ -440,6 +426,30 @@ ISR(TIMER1_COMPA_vect)
}
// Draw main display
void drawMainDisplay()
{
// Initial display setup
display.drawFastVLine(41, 0, 10, BLACK);
display.drawFastVLine(24, 10, 21, BLACK);
display.drawFastVLine(59, 10, 21, BLACK);
display.drawFastHLine(0, 9, display.width(), BLACK);
display.drawFastHLine(0, 20, 24, BLACK);
display.drawFastHLine(60, 20, 24, BLACK);
display.drawFastHLine(0, 30, 24, BLACK);
display.drawFastHLine(60, 30, 24, BLACK);
// Display the soft keys by calling changePage()
changePage();
// Update the ABC keys
displayABCkeys();
// write to display
display.display();
}
// Cycle through soft-key pages
void changePage()
{