fix display after merge of pr #313
This commit is contained in:
parent
667107e3d7
commit
8f79011366
@ -131,7 +131,7 @@ extern time_t userUTCTime;
|
||||
#include "lorawan.h"
|
||||
#endif
|
||||
|
||||
#if(HAS_DISPLAY)
|
||||
#ifdef HAS_DISPLAY
|
||||
#include "display.h"
|
||||
#endif
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
void irqHandler(void *pvParameters);
|
||||
|
||||
#if(HAS_DISPLAY)
|
||||
#ifdef HAS_DISPLAY
|
||||
#include "display.h"
|
||||
void IRAM_ATTR DisplayIRQ();
|
||||
#endif
|
||||
|
@ -18,7 +18,7 @@ void start_ota_update();
|
||||
int version_compare(const String v1, const String v2);
|
||||
void display(const uint8_t row, const std::string status,
|
||||
const std::string msg);
|
||||
#if(HAS_DISPLAY)
|
||||
#ifdef HAS_DISPLAY
|
||||
void show_progress(unsigned long current, unsigned long size);
|
||||
#endif
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#if(HAS_DISPLAY)
|
||||
#ifdef HAS_DISPLAY
|
||||
|
||||
/*
|
||||
|
||||
|
@ -24,7 +24,7 @@ void irqHandler(void *pvParameters) {
|
||||
#endif
|
||||
|
||||
// display needs refresh?
|
||||
#if(HAS_DISPLAY)
|
||||
#ifdef HAS_DISPLAY
|
||||
if (InterruptStatus & DISPLAY_IRQ)
|
||||
refreshtheDisplay();
|
||||
#endif
|
||||
@ -52,7 +52,7 @@ void irqHandler(void *pvParameters) {
|
||||
// esp32 hardware timer triggered interrupt service routines
|
||||
// they notify the irq handler task
|
||||
|
||||
#if(HAS_DISPLAY)
|
||||
#ifdef HAS_DISPLAY
|
||||
void IRAM_ATTR DisplayIRQ() {
|
||||
BaseType_t xHigherPriorityTaskWoken;
|
||||
xHigherPriorityTaskWoken = pdFALSE;
|
||||
|
10
src/main.cpp
10
src/main.cpp
@ -47,8 +47,10 @@ Tasks using i2c bus all must have same priority, because using mutex semaphore
|
||||
|
||||
// ESP32 hardware timers
|
||||
-------------------------------------------------------------------------------
|
||||
0 displayIRQ -> display refresh -> 40ms (DISPLAYREFRESH_MS in
|
||||
paxcounter.conf) 1 ppsIRQ -> pps clock irq -> 1sec 2 unused 3 unused
|
||||
0 displayIRQ -> display refresh -> 40ms (DISPLAYREFRESH_MS in paxcounter.conf)
|
||||
1 ppsIRQ -> pps clock irq -> 1sec
|
||||
2 unused
|
||||
3 unused
|
||||
|
||||
|
||||
// Interrupt routines
|
||||
@ -306,7 +308,7 @@ void setup() {
|
||||
#endif
|
||||
|
||||
// initialize display
|
||||
#if(HAS_DISPLAY)
|
||||
#ifdef HAS_DISPLAY
|
||||
strcat_P(features, " OLED");
|
||||
DisplayState = cfg.screenon;
|
||||
init_display(PRODUCTNAME, PROGVERSION); // note: blocking call
|
||||
@ -382,7 +384,7 @@ void setup() {
|
||||
ESP_LOGI(TAG, "Starting Timers...");
|
||||
|
||||
// display interrupt
|
||||
#if(HAS_DISPLAY)
|
||||
#ifdef HAS_DISPLAY
|
||||
// https://techtutorialsx.com/2017/10/07/esp32-arduino-timer-interrupts/
|
||||
// prescaler 80 -> divides 80 MHz CPU freq to 1 MHz, timer 0, count up
|
||||
displayIRQ = timerBegin(0, 80, true);
|
||||
|
@ -48,7 +48,7 @@ void start_ota_update() {
|
||||
|
||||
switch_LED(LED_ON);
|
||||
|
||||
#if(HAS_DISPLAY)
|
||||
#ifdef HAS_DISPLAY
|
||||
u8x8.begin();
|
||||
u8x8.setFont(u8x8_font_chroma48medium8_r);
|
||||
u8x8.clear();
|
||||
@ -266,7 +266,7 @@ int do_ota_update() {
|
||||
goto abort;
|
||||
}
|
||||
|
||||
#if(HAS_DISPLAY)
|
||||
#ifdef HAS_DISPLAY
|
||||
// register callback function for showing progress while streaming data
|
||||
Update.onProgress(&show_progress);
|
||||
#endif
|
||||
@ -309,7 +309,7 @@ retry:
|
||||
|
||||
void display(const uint8_t row, const std::string status,
|
||||
const std::string msg) {
|
||||
#if(HAS_DISPLAY)
|
||||
#ifdef HAS_DISPLAY
|
||||
u8x8.setCursor(14, row);
|
||||
u8x8.print((status.substr(0, 2)).c_str());
|
||||
if (!msg.empty()) {
|
||||
@ -320,7 +320,7 @@ void display(const uint8_t row, const std::string status,
|
||||
#endif
|
||||
}
|
||||
|
||||
#if(HAS_DISPLAY)
|
||||
#ifdef HAS_DISPLAY
|
||||
// callback function to show download progress while streaming data
|
||||
void show_progress(unsigned long current, unsigned long size) {
|
||||
char buf[17];
|
||||
|
Loading…
Reference in New Issue
Block a user