Merge branch 'development' of https://github.com/cyberman54/ESP32-Paxcounter into development

This commit is contained in:
cyberman54 2022-11-13 22:17:27 +01:00
commit d231eee543

View File

@ -8,16 +8,19 @@
#include "power.h" #include "power.h"
#include "timekeeper.h" #include "timekeeper.h"
#define DISPLAY_PAGES (7) // number of paxcounter display pages
#define PLOTBUFFERSIZE (MY_DISPLAY_WIDTH * MY_DISPLAY_HEIGHT / 8)
#define QR_VERSION 3 // 29 x 29px
// Settings for OLED display library
#if (HAS_DISPLAY) == 1 #if (HAS_DISPLAY) == 1
#include <OneBitDisplay.h> #include <OneBitDisplay.h>
extern ONE_BIT_DISPLAY *dp; extern ONE_BIT_DISPLAY *dp;
#elif (HAS_DISPLAY) == 2
#include <bb_spi_lcd.h>
extern BB_SPI_LCD *dp;
#endif
#define DISPLAY_PAGES (7) // number of paxcounter display pages
#define PLOTBUFFERSIZE (MY_DISPLAY_WIDTH * MY_DISPLAY_HEIGHT / 8)
// settings for OLED display library
#if (HAS_DISPLAY) == 1
#define MY_FONT_SMALL FONT_6x8 #define MY_FONT_SMALL FONT_6x8
#define MY_FONT_NORMAL FONT_8x8 #define MY_FONT_NORMAL FONT_8x8
#define MY_FONT_LARGE FONT_16x32 #define MY_FONT_LARGE FONT_16x32
@ -27,17 +30,17 @@ extern ONE_BIT_DISPLAY *dp;
#ifndef MY_DISPLAY_RST #ifndef MY_DISPLAY_RST
#define MY_DISPLAY_RST NOT_A_PIN #define MY_DISPLAY_RST NOT_A_PIN
#endif #endif
#ifdef MY_DISPLAY_ADDR #ifdef MY_DISPLAY_ADDR
#define OLED_ADDR MY_DISPLAY_ADDR #define OLED_ADDR MY_DISPLAY_ADDR
#else #else
#define OLED_ADDR -1 #define OLED_ADDR -1
#endif #endif
#ifndef OLED_FREQUENCY #ifndef OLED_FREQUENCY
#define OLED_FREQUENCY 400000L #define OLED_FREQUENCY 400000L
#endif #endif
#ifndef OLED_TYPE
#define OLED_TYPE OLED_128x64
#endif
#ifndef MY_DISPLAY_FGCOLOR #ifndef MY_DISPLAY_FGCOLOR
#define MY_DISPLAY_FGCOLOR 1 // OLED_WHITE #define MY_DISPLAY_FGCOLOR 1 // OLED_WHITE
#endif #endif
@ -45,15 +48,19 @@ extern ONE_BIT_DISPLAY *dp;
#define MY_DISPLAY_BGCOLOR 0 // OLED_BLACK #define MY_DISPLAY_BGCOLOR 0 // OLED_BLACK
#endif #endif
// Settings for TFT display library // settings for TFT display library
#elif (HAS_DISPLAY) > 1 #elif (HAS_DISPLAY) == 2
#include <bb_spi_lcd.h> #define MY_FONT_SMALL 2
extern BB_SPI_LCD *dp; #define MY_FONT_NORMAL 2
#define MY_FONT_LARGE 2
#define MY_FONT_STRETCHED 2
#define MY_DISPLAY_FIRSTLINE 30
#ifndef TFT_FREQUENCY #ifndef TFT_FREQUENCY
#define TFT_FREQUENCY 400000L #define TFT_FREQUENCY 400000L
#endif #endif
#ifndef MY_DISPLAY_FGCOLOR #ifndef MY_DISPLAY_FGCOLOR
#define MY_DISPLAY_FGCOLOR TFT_YELLOW #define MY_DISPLAY_FGCOLOR TFT_YELLOW
#endif #endif
@ -63,39 +70,31 @@ extern BB_SPI_LCD *dp;
#endif #endif
// Fonts for large TFT display library // setup display hardware type, default is OLED 128x64
#if (HAS_DISPLAY) == 2 #ifndef OLED_TYPE
#define MY_FONT_SMALL FONT_12x16 #define OLED_TYPE OLED_128x64
#define MY_FONT_NORMAL FONT_12x16
#define MY_FONT_LARGE FONT_12x16
#define MY_FONT_STRETCHED FONT_12x16
#define MY_DISPLAY_FIRSTLINE 30
#endif #endif
// Settings for small TFT display library
#if (HAS_DISPLAY) == 3
#define MY_FONT_SMALL FONT_6x8
#define MY_FONT_NORMAL FONT_8x8
#define MY_FONT_LARGE FONT_16x16
#define MY_FONT_STRETCHED FONT_12x16
#define MY_DISPLAY_FIRSTLINE 30
#endif
// Default settings for all display types
#ifndef MY_DISPLAY_FLIP #ifndef MY_DISPLAY_FLIP
#define MY_DISPLAY_FLIP 0 #define MY_DISPLAY_FLIP 0
#endif #endif
#ifndef MY_DISPLAY_WIDTH #ifndef MY_DISPLAY_WIDTH
#define MY_DISPLAY_WIDTH 128 #define MY_DISPLAY_WIDTH 128 // Width in pixels of OLED-display, must be 32X
#endif #endif
#ifndef MY_DISPLAY_HEIGHT #ifndef MY_DISPLAY_HEIGHT
#define MY_DISPLAY_HEIGHT 64 #define MY_DISPLAY_HEIGHT 64 // Height in pixels of OLED-display, must be 64X
#endif #endif
#ifndef MY_DISPLAY_FIRSTLINE #ifndef MY_DISPLAY_FIRSTLINE
#define MY_DISPLAY_FIRSTLINE 0 #define MY_DISPLAY_FIRSTLINE 0
#endif #endif
// settings for qr code generator
#define QR_VERSION 3 // 29 x 29px
const uint8_t QR_SCALEFACTOR = (MY_DISPLAY_HEIGHT - 4) / 29; // 4px borderlines const uint8_t QR_SCALEFACTOR = (MY_DISPLAY_HEIGHT - 4) / 29; // 4px borderlines
extern uint8_t DisplayIsOn; extern uint8_t DisplayIsOn;
extern hw_timer_t *displayIRQ; extern hw_timer_t *displayIRQ;
extern uint8_t volatile channel; // wifi channel rotation counter extern uint8_t volatile channel; // wifi channel rotation counter