Mark extended firmware and prepare for getdisplay() replacement
This commit is contained in:
parent
fb3af0bf83
commit
f6e2fa7806
|
@ -501,7 +501,7 @@ def prebuild(env):
|
|||
genereateUserTasks(os.path.join(outPath(), TASK_INCLUDE))
|
||||
generateFile(os.path.join(basePath(),XDR_FILE),os.path.join(outPath(),XDR_INCLUDE),generateXdrMappings)
|
||||
generateFile(os.path.join(basePath(),GROVE_CONFIG_IN),os.path.join(outPath(),GROVE_CONFIG),generateGroveDefs,inMode='r')
|
||||
version="dev"+datetime.now().strftime("%Y%m%d")
|
||||
version = "dev{}{}".format(datetime.now().strftime("%Y%m%d"), "-ext")
|
||||
env.Append(CPPDEFINES=[('GWDEVVERSION',version)])
|
||||
|
||||
def cleangenerated(source, target, env):
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3
|
||||
|
||||
#include <Arduino.h>
|
||||
|
@ -40,7 +41,8 @@ GxEPD2_BW<GxEPD2_420, GxEPD2_420::HEIGHT> & getdisplay(){return display;}
|
|||
// Set display type and SPI pins for display
|
||||
GxEPD2_BW<GxEPD2_420_GDEY042T81, GxEPD2_420_GDEY042T81::HEIGHT> display(GxEPD2_420_GDEY042T81(OBP_SPI_CS, OBP_SPI_DC, OBP_SPI_RST, OBP_SPI_BUSY)); // GDEW042T2 400x300, UC8176 (IL0398)
|
||||
// Export display in new funktion
|
||||
GxEPD2_BW<GxEPD2_420_GDEY042T81, GxEPD2_420_GDEY042T81::HEIGHT> & getdisplay(){return display;}
|
||||
GxEPD2_BW<GxEPD2_420_GDEY042T81, GxEPD2_420_GDEY042T81::HEIGHT> & getdisplay(){return display;} // DEPRECATED
|
||||
gxepd2display *epd = &display;
|
||||
#endif
|
||||
|
||||
#ifdef DISPLAY_GYE042A87
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
#ifndef _OBP60EXTENSIONPORT_H
|
||||
#define _OBP60EXTENSIONPORT_H
|
||||
|
||||
|
@ -46,7 +47,9 @@ GxEPD2_BW<GxEPD2_420, GxEPD2_420::HEIGHT> & getdisplay();
|
|||
#endif
|
||||
|
||||
#ifdef DISPLAY_GDEY042T81
|
||||
GxEPD2_BW<GxEPD2_420_GDEY042T81, GxEPD2_420_GDEY042T81::HEIGHT> & getdisplay();
|
||||
GxEPD2_BW<GxEPD2_420_GDEY042T81, GxEPD2_420_GDEY042T81::HEIGHT> & getdisplay(); // DEPRECATED
|
||||
typedef GxEPD2_BW<GxEPD2_420_GDEY042T81, GxEPD2_420_GDEY042T81::HEIGHT> gxepd2display;
|
||||
extern gxepd2display *epd;
|
||||
#endif
|
||||
|
||||
#ifdef DISPLAY_GYE042A87
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3
|
||||
|
||||
#include "Pagedata.h"
|
||||
|
@ -6,16 +7,20 @@
|
|||
|
||||
class PageVoltage : public Page
|
||||
{
|
||||
bool init = false; // Marker for init done
|
||||
uint8_t average = 0; // Average type [0...3], 0=off, 1=10s, 2=60s, 3=300s
|
||||
bool trend = true; // Trend indicator [0|1], 0=off, 1=on
|
||||
double raw = 0;
|
||||
char mode = 'D'; // display mode (A)nalog | (D)igital
|
||||
private:
|
||||
bool init = false; // Marker for init done
|
||||
uint8_t average = 0; // Average type [0...3], 0=off, 1=10s, 2=60s, 3=300s
|
||||
bool trend = true; // Trend indicator [0|1], 0=off, 1=on
|
||||
double raw = 0;
|
||||
char mode = 'D'; // display mode (A)nalog | (D)igital
|
||||
|
||||
public:
|
||||
PageVoltage(CommonData &common){
|
||||
commonData = &common;
|
||||
common.logger->logDebug(GwLog::LOG,"Instantiate PageVoltage");
|
||||
config = commonData->config;
|
||||
logger = commonData->logger;
|
||||
|
||||
logger->logDebug(GwLog::LOG,"Instantiate PageVoltage");
|
||||
if (hasFRAM) {
|
||||
average = fram.read(FRAM_VOLTAGE_AVG);
|
||||
trend = fram.read(FRAM_VOLTAGE_TREND);
|
||||
|
@ -23,6 +28,10 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
~PageVoltage(){
|
||||
logger->logDebug(GwLog::LOG,"Destroy PageVoltage");
|
||||
}
|
||||
|
||||
virtual void setupKeys(){
|
||||
Page::setupKeys();
|
||||
commonData->keydata[0].label = "AVG";
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
#include <Arduino.h>
|
||||
#include "GwApi.h"
|
||||
|
@ -98,6 +100,10 @@ typedef struct{
|
|||
uint8_t length_sec; // seconds until alarm disappeares without user interaction
|
||||
} AlarmData;
|
||||
|
||||
typedef struct{
|
||||
int voltage = 0;
|
||||
} AvgData;
|
||||
|
||||
typedef struct{
|
||||
GwApi::Status status;
|
||||
GwLog *logger=NULL;
|
||||
|
@ -107,6 +113,7 @@ typedef struct{
|
|||
TouchKeyData keydata[6];
|
||||
BacklightData backlight;
|
||||
AlarmData alarm;
|
||||
AvgData avgdata;
|
||||
GwApi::BoatValue *time=NULL;
|
||||
GwApi::BoatValue *date=NULL;
|
||||
uint16_t fgcolor;
|
||||
|
@ -117,9 +124,11 @@ typedef struct{
|
|||
|
||||
//a base class that all pages must inherit from
|
||||
class Page{
|
||||
protected:
|
||||
protected:
|
||||
CommonData *commonData;
|
||||
public:
|
||||
GwConfigHandler *config;
|
||||
GwLog *logger;
|
||||
public:
|
||||
int refreshtime = 1000;
|
||||
virtual int displayPage(PageData &pageData)=0;
|
||||
virtual void displayNew(PageData &pageData){}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
#if defined BOARD_OBP60S3 || defined BOARD_OBP40S3
|
||||
#include "obp60task.h"
|
||||
#include "Pagedata.h" // Data exchange for pages
|
||||
|
|
Loading…
Reference in New Issue