diff options
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/main.cpp b/src/main.cpp index 70f2559..ee7435a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,6 +1,5 @@ #include <GxEPD2_BW.h> -#include <Fonts/FreeSansBold9pt7b.h> -#include <Fonts/FreeSans9pt7b.h> +#include <U8g2_for_Adafruit_GFX.h> #include <WiFi.h> #include "calendar.h" @@ -22,6 +21,12 @@ */ GxEPD2_BW<GxEPD2_420, GxEPD2_420::HEIGHT> display(GxEPD2_420(/*CS=*/ 15, /*DC=*/ 27, /*RST=*/ 26, /*BUSY=*/ 25)); +U8G2_FOR_ADAFRUIT_GFX u8g2Fonts; + +extern GxEPD2_GFX_BASE_CLASS &get_display() { + return display; +} + void board_spi_setup() { /* board-specific setup */ @@ -32,18 +37,19 @@ void board_spi_setup() { void display_setup() { display.init(); board_spi_setup(); + u8g2Fonts.begin(display); } void draw() { display.setRotation(1); - display.setFont(&FreeSans9pt7b); - display.setTextColor(GxEPD_BLACK); + u8g2Fonts.setBackgroundColor(GxEPD_WHITE); + u8g2Fonts.setForegroundColor(GxEPD_BLACK); display.firstPage(); do { display.fillScreen(GxEPD_WHITE); - draw_calendar(display, 30, 30); - draw_qrcode_wlan(display, 30, 200, wifi_ssid, wifi_psk); + draw_calendar(30, 30); + draw_qrcode_wlan(30, 200, wifi_ssid, wifi_psk); } while(display.nextPage()); } |
