mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2025-12-28 13:13:07 +01:00
Compare commits
17 Commits
r20250116a
...
a73f50ba74
| Author | SHA1 | Date | |
|---|---|---|---|
| a73f50ba74 | |||
| 9d395c719a | |||
| 322ae30858 | |||
|
|
87a7a79358 | ||
|
|
e7216e6d2b | ||
|
|
e7f3430ed6 | ||
|
|
2c2d21535b | ||
|
|
27b02c4860 | ||
| e917a7fc76 | |||
|
|
10552763fb | ||
|
|
24386d4d42 | ||
|
|
49be7f117a | ||
|
|
e70660c981 | ||
|
|
4395c623ea | ||
|
|
dfc79c80dc | ||
|
|
a129d865c9 | ||
| 57e194e39d |
@@ -2,5 +2,5 @@ Craete new page for OBP60
|
||||
1. Create page under /lib/obp60task/PageXXXX.cpp
|
||||
2. Set page name in PageXXXX.cpp on file name
|
||||
3. Register new page in /lib/obp60task/obp60task.cpp line 242 (registerAllPages)
|
||||
4. Add new page in /lib/obp60task/config.json for each page type or add new page to gen_set.pl and run it to auto-generate the relevant section of config.json
|
||||
4. Add new page in /lib/obp60task/config.json for each page type or add new page to gen_set.py and run it to auto-generate the relevant section of config.json
|
||||
|
||||
|
||||
@@ -328,16 +328,11 @@ void displayHeader(CommonData &commonData, GwApi::BoatValue *date, GwApi::BoatVa
|
||||
|
||||
// Display key lock status
|
||||
if (commonData.keylock) {
|
||||
getdisplay().drawXBitmap(150, 1, lock_bits, icon_width, icon_height, commonData.fgcolor);
|
||||
getdisplay().drawXBitmap(170, 1, lock_bits, icon_width, icon_height, commonData.fgcolor);
|
||||
} else {
|
||||
getdisplay().drawXBitmap(150, 1, swipe_bits, icon_width, icon_height, commonData.fgcolor);
|
||||
getdisplay().drawXBitmap(166, 1, swipe_bits, swipe_width, swipe_height, commonData.fgcolor);
|
||||
}
|
||||
|
||||
// Current page number in a small box
|
||||
getdisplay().setFont(&Ubuntu_Bold8pt7b);
|
||||
getdisplay().drawRect(170, 2, 20, 15, commonData.fgcolor);
|
||||
drawTextCenter(179, 9, String(commonData.data.actpage));
|
||||
|
||||
// Heartbeat as dot
|
||||
getdisplay().setTextColor(commonData.fgcolor);
|
||||
getdisplay().setFont(&Ubuntu_Bold32pt7b);
|
||||
@@ -382,13 +377,21 @@ void displayFooter(CommonData &commonData) {
|
||||
getdisplay().setTextColor(commonData.fgcolor);
|
||||
|
||||
// Frame around key icon area
|
||||
getdisplay().drawLine(0, 280, 399, 280, commonData.fgcolor);
|
||||
if (! commonData.keylock) {
|
||||
getdisplay().drawLine(68, 280, 68, 299, commonData.fgcolor);
|
||||
getdisplay().drawLine(134, 280, 134, 299, commonData.fgcolor);
|
||||
getdisplay().drawLine(200, 280, 200, 299, commonData.fgcolor);
|
||||
getdisplay().drawLine(266, 280, 266, 299, commonData.fgcolor);
|
||||
getdisplay().drawLine(332, 280, 332, 299, commonData.fgcolor);
|
||||
// horizontal elements
|
||||
const uint16_t top = 280;
|
||||
const uint16_t bottom = 299;
|
||||
getdisplay().drawLine(commonData.keydata[0].x, top, commonData.keydata[0].x+10, top, commonData.fgcolor);
|
||||
getdisplay().drawLine(commonData.keydata[1].x-10, top, commonData.keydata[1].x+10, top, commonData.fgcolor);
|
||||
getdisplay().drawLine(commonData.keydata[2].x-10, top, commonData.keydata[2].x+10, top, commonData.fgcolor);
|
||||
getdisplay().drawLine(commonData.keydata[4].x-10, top, commonData.keydata[4].x+10, top, commonData.fgcolor);
|
||||
getdisplay().drawLine(commonData.keydata[5].x-10, top, commonData.keydata[5].x+10, top, commonData.fgcolor);
|
||||
getdisplay().drawLine(commonData.keydata[5].x + commonData.keydata[5].w - 10, top, commonData.keydata[5].x + commonData.keydata[5].w + 1, top, commonData.fgcolor);
|
||||
// vertical key separators
|
||||
getdisplay().drawLine(commonData.keydata[0].x + commonData.keydata[0].w, top, commonData.keydata[0].x + commonData.keydata[0].w, bottom, commonData.fgcolor);
|
||||
getdisplay().drawLine(commonData.keydata[1].x + commonData.keydata[1].w, top, commonData.keydata[1].x + commonData.keydata[1].w, bottom, commonData.fgcolor);
|
||||
getdisplay().drawLine(commonData.keydata[3].x + commonData.keydata[3].w, top, commonData.keydata[3].x + commonData.keydata[3].w, bottom, commonData.fgcolor);
|
||||
getdisplay().drawLine(commonData.keydata[4].x + commonData.keydata[4].w, top, commonData.keydata[4].x + commonData.keydata[4].w, bottom, commonData.fgcolor);
|
||||
for (int i = 0; i < 6; i++) {
|
||||
uint16_t x, y;
|
||||
if (commonData.keydata[i].label.length() > 0) {
|
||||
@@ -412,6 +415,9 @@ void displayFooter(CommonData &commonData) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Current page number in a small box
|
||||
getdisplay().drawRect(190, 280, 23, 19, commonData.fgcolor);
|
||||
drawTextCenter(200, 289, String(commonData.data.actpage));
|
||||
} else {
|
||||
getdisplay().setCursor(65, 295);
|
||||
getdisplay().print("Press 1 and 6 fast to unlock keys");
|
||||
|
||||
@@ -36,6 +36,7 @@ extern const GFXfont DSEG7Classic_BoldItalic20pt7b;
|
||||
extern const GFXfont DSEG7Classic_BoldItalic30pt7b;
|
||||
extern const GFXfont DSEG7Classic_BoldItalic42pt7b;
|
||||
extern const GFXfont DSEG7Classic_BoldItalic60pt7b;
|
||||
extern const GFXfont Atari16px;
|
||||
|
||||
// Global functions
|
||||
#ifdef DISPLAY_GDEW042T2
|
||||
@@ -114,11 +115,6 @@ static unsigned char right_bits[] PROGMEM = {
|
||||
0xfe, 0x7f, 0xfe, 0xff, 0xfe, 0xff, 0xfe, 0x7f, 0xfe, 0x3f, 0x80, 0x1f,
|
||||
0x80, 0x0f, 0x80, 0x07, 0x80, 0x03, 0x00, 0x00 };
|
||||
|
||||
static unsigned char swipe_bits[] = {
|
||||
0x30, 0x00, 0x48, 0x00, 0x48, 0x00, 0x48, 0x00, 0xc8, 0x05, 0x48, 0x0e,
|
||||
0x4a, 0x12, 0x4d, 0x32, 0x09, 0x50, 0x41, 0x44, 0x62, 0x4c, 0xf2, 0x5f,
|
||||
0x64, 0x2c, 0x48, 0x24, 0x10, 0x10, 0xe0, 0x0f };
|
||||
|
||||
static unsigned char lock_bits[] PROGMEM = {
|
||||
0xc0, 0x03, 0x60, 0x06, 0x30, 0x0c, 0x10, 0x08, 0x10, 0x08, 0x10, 0x08,
|
||||
0xfc, 0x3f, 0x04, 0x20, 0x04, 0x20, 0x84, 0x21, 0x84, 0x21, 0x84, 0x21,
|
||||
@@ -139,19 +135,38 @@ static unsigned char fram_bits[] PROGMEM = {
|
||||
0xff, 0xff, 0xf8, 0x1f, 0xf8, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x1f,
|
||||
0xf8, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x1f };
|
||||
|
||||
static unsigned char ap_bits[] = {
|
||||
0xe0, 0x03, 0x18, 0x0c, 0x04, 0x10, 0xc2, 0x21, 0x30, 0x06, 0x08, 0x08,
|
||||
0xc0, 0x01, 0x20, 0x02, 0x00, 0x00, 0x80, 0x00, 0xc0, 0x01, 0xc0, 0x01,
|
||||
0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00 };
|
||||
|
||||
static unsigned char dish_bits[] PROGMEM= {
|
||||
0x3c, 0x00, 0x42, 0x18, 0xfa, 0x1b, 0x02, 0x04, 0x02, 0x0a, 0x02, 0x09,
|
||||
0x82, 0x08, 0x06, 0x0a, 0x0e, 0x1b, 0x9c, 0x2b, 0x38, 0x2b, 0x74, 0x20,
|
||||
0xec, 0x1f, 0x1c, 0x00, 0xf4, 0x00, 0xfe, 0x03 };
|
||||
|
||||
static std::map<String, unsigned char *> iconmap = {
|
||||
{"LEFT", left_bits},
|
||||
{"RIGHT", right_bits},
|
||||
{"SWIPE", swipe_bits},
|
||||
{"LOCK", lock_bits},
|
||||
{"PLUS", plus_bits},
|
||||
{"MINUS", minus_bits}
|
||||
{"MINUS", minus_bits},
|
||||
{"DISH", dish_bits},
|
||||
{"AP", ap_bits}
|
||||
};
|
||||
|
||||
// Other symbols
|
||||
#define swipe_width 24
|
||||
#define swipe_height 16
|
||||
static unsigned char swipe_bits[] PROGMEM = {
|
||||
0x00, 0x06, 0x00, 0x24, 0x09, 0x24, 0x12, 0x09, 0x48, 0x7f, 0x09, 0xfe,
|
||||
0x12, 0xb9, 0x48, 0x24, 0xc9, 0x25, 0x40, 0x49, 0x02, 0xa0, 0x49, 0x06,
|
||||
0x20, 0x01, 0x0a, 0x20, 0x00, 0x08, 0x40, 0x00, 0x08, 0x40, 0x00, 0x08,
|
||||
0x80, 0x00, 0x04, 0x00, 0x01, 0x04, 0x00, 0x02, 0x02, 0x00, 0xfc, 0x01 };
|
||||
|
||||
#define exclamation_width 32
|
||||
#define exclamation_height 32
|
||||
static unsigned char exclamation_bits[] = {
|
||||
static unsigned char exclamation_bits[] PROGMEM = {
|
||||
0x00, 0xc0, 0x03, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0xb0, 0x0d, 0x00,
|
||||
0x00, 0xd8, 0x1b, 0x00, 0x00, 0xec, 0x37, 0x00, 0x00, 0xf6, 0x6f, 0x00,
|
||||
0x00, 0x3b, 0xdc, 0x00, 0x80, 0x3d, 0xbc, 0x01, 0xc0, 0x3e, 0x7c, 0x03,
|
||||
|
||||
@@ -22,40 +22,45 @@ long starttime = 0; // Start time point for pressed key
|
||||
|
||||
void initKeys(CommonData &commonData) {
|
||||
// coordinates for virtual keyboard keys
|
||||
commonData.keydata[0].x = 1;
|
||||
commonData.keydata[0].y = 281;
|
||||
commonData.keydata[0].w = 67;
|
||||
commonData.keydata[0].h = 18;
|
||||
|
||||
commonData.keydata[1].x = 69;
|
||||
commonData.keydata[1].y = 281;
|
||||
commonData.keydata[1].w = 66;
|
||||
commonData.keydata[1].h = 18;
|
||||
static uint16_t top = 281;
|
||||
static uint16_t width = 65;
|
||||
static uint16_t height = 18;
|
||||
|
||||
commonData.keydata[2].x = 135;
|
||||
commonData.keydata[2].y = 281;
|
||||
commonData.keydata[2].w = 66;
|
||||
commonData.keydata[2].h = 18;
|
||||
commonData.keydata[0].x = 0;
|
||||
commonData.keydata[0].y = top;
|
||||
commonData.keydata[0].w = width + 1;
|
||||
commonData.keydata[0].h = height;
|
||||
|
||||
commonData.keydata[3].x = 201;
|
||||
commonData.keydata[3].y = 281;
|
||||
commonData.keydata[3].w = 66;
|
||||
commonData.keydata[3].h = 18;
|
||||
commonData.keydata[1].x = commonData.keydata[0].x + commonData.keydata[0].w + 1;
|
||||
commonData.keydata[1].y = top;
|
||||
commonData.keydata[1].w = width;
|
||||
commonData.keydata[1].h = height;
|
||||
|
||||
commonData.keydata[4].x = 267;
|
||||
commonData.keydata[4].y = 281;
|
||||
commonData.keydata[4].w = 66;
|
||||
commonData.keydata[4].h = 18;
|
||||
commonData.keydata[2].x = commonData.keydata[1].x + commonData.keydata[1].w + 1;
|
||||
commonData.keydata[2].y = top;
|
||||
commonData.keydata[2].w = width;
|
||||
commonData.keydata[2].h = height;
|
||||
|
||||
commonData.keydata[5].x = 333;
|
||||
commonData.keydata[5].y = 281;
|
||||
commonData.keydata[5].w = 66;
|
||||
commonData.keydata[5].h = 18;
|
||||
commonData.keydata[3].x = commonData.keydata[2].x + commonData.keydata[2].w + 1;
|
||||
commonData.keydata[3].y = top;
|
||||
commonData.keydata[3].w = width;
|
||||
commonData.keydata[3].h = height;
|
||||
|
||||
commonData.keydata[4].x = commonData.keydata[3].x + commonData.keydata[3].w + 1;
|
||||
commonData.keydata[4].y = top;
|
||||
commonData.keydata[4].w = width;
|
||||
commonData.keydata[4].h = height;
|
||||
|
||||
commonData.keydata[5].x = commonData.keydata[4].x + commonData.keydata[4].w + 1;
|
||||
commonData.keydata[5].y = top;
|
||||
commonData.keydata[5].w = width;
|
||||
commonData.keydata[5].h = height;
|
||||
}
|
||||
|
||||
#ifdef HARDWARE_V21
|
||||
// Keypad functions for original OBP60 hardware
|
||||
int readKeypad(uint thSensitivity) {
|
||||
int readKeypad(GwLog* logger, uint thSensitivity) {
|
||||
|
||||
// Touch sensor values
|
||||
// 35000 - Not touched
|
||||
@@ -105,14 +110,14 @@ void initKeys(CommonData &commonData) {
|
||||
keypad[6] = 0;
|
||||
}
|
||||
// Nothing touched
|
||||
if(keypad[1] == 0 && keypad[2] == 0 && keypad[3] == 0 && keypad[4] == 0 && keypad[5] == 0 && keypad[6] == 0){
|
||||
/* if(keypad[1] == 0 && keypad[2] == 0 && keypad[3] == 0 && keypad[4] == 0 && keypad[5] == 0 && keypad[6] == 0){
|
||||
keypad[0] = 1;
|
||||
}
|
||||
else{
|
||||
keypad[0] = 0;
|
||||
}
|
||||
} */
|
||||
|
||||
for (int i = 0; i < 9; i++) {
|
||||
for (int i = 1; i <= 6; i++) {
|
||||
if(i > 0){
|
||||
// Convert keypad to keycode
|
||||
if(keypad[i] == 1){
|
||||
@@ -136,11 +141,13 @@ void initKeys(CommonData &commonData) {
|
||||
}
|
||||
// Detect a very short keynumber (10ms)
|
||||
if (millis() > starttime + 10 && keycode == keycodeold && keylock == true) {
|
||||
logger->logDebug(GwLog::LOG,"Very short 20ms key touch: %d", keycode);
|
||||
|
||||
// Process only valid keys
|
||||
if(keycode == 1 || keycode == 6){
|
||||
if(keycode == 1 || keycode == 4 || keycode == 5 || keycode == 6){
|
||||
keycode2 = keycode;
|
||||
}
|
||||
// Clear by unvalid keys
|
||||
// Clear by invalid keys
|
||||
else{
|
||||
keycode2 = 0;
|
||||
keycodeold2 = 0;
|
||||
@@ -152,6 +159,7 @@ void initKeys(CommonData &commonData) {
|
||||
}
|
||||
// Detect a short keynumber (200ms)
|
||||
if (keyoff == false && millis() > starttime + 200 && keycode == keycodeold && keylock == true) {
|
||||
logger->logDebug(GwLog::LOG,"Short 200ms key touch: %d", keycode);
|
||||
keystatus = keycode;
|
||||
keycode = 0;
|
||||
keycodeold = 0;
|
||||
@@ -163,6 +171,21 @@ void initKeys(CommonData &commonData) {
|
||||
}
|
||||
}
|
||||
|
||||
// System page with key 5 and 4 in fast series
|
||||
if (keycode2 == 5 && keycodeold2 == 4) {
|
||||
logger->logDebug(GwLog::LOG,"Keycode for system page");
|
||||
keycode = 0;
|
||||
keycodeold = 0;
|
||||
keycode2 = 0;
|
||||
keycodeold2 = 0;
|
||||
keystatus = 12;
|
||||
buzzer(TONE4, 50);
|
||||
delay(30);
|
||||
buzzer(TONE4, 50);
|
||||
delay(30);
|
||||
buzzer(TONE4, 50);
|
||||
}
|
||||
|
||||
// Key lock with key 1 and 6 or 6 and 1 in fast series
|
||||
if((keycode2 == 1 && keycodeold2 == 6) || (keycode2 == 6 && keycodeold2 == 1)) {
|
||||
keycode = 0;
|
||||
@@ -214,33 +237,39 @@ void initKeys(CommonData &commonData) {
|
||||
#endif
|
||||
|
||||
#ifdef HARDWARE_LIGHT
|
||||
int readSensorpads(){
|
||||
// Read key code
|
||||
if(digitalRead(UP) == LOW){
|
||||
keycode = 10; // Left swipe
|
||||
}
|
||||
else if(digitalRead(DOWN) == LOW){
|
||||
keycode = 9; // Right swipe
|
||||
}
|
||||
else if(digitalRead(CONF) == LOW){
|
||||
keycode = 3; // Key 3
|
||||
}
|
||||
else if(digitalRead(MENUE) == LOW){
|
||||
keycode = 1; // Key 1
|
||||
}
|
||||
else if(digitalRead(EXIT) == LOW){
|
||||
keycode = 2; // Key 2
|
||||
}
|
||||
else{
|
||||
keycode = 0; // No key activ
|
||||
}
|
||||
return keycode;
|
||||
}
|
||||
|
||||
// Keypad functions for OBP60 clone (thSensitivity is inactiv)
|
||||
int readKeypad(uint thSensitivity) {
|
||||
int readKeypad(GwLog* logger, uint thSensitivity) {
|
||||
pinMode(UP, INPUT);
|
||||
pinMode(DOWN, INPUT);
|
||||
pinMode(CONF, INPUT);
|
||||
pinMode(MENUE, INPUT);
|
||||
pinMode(EXIT, INPUT);
|
||||
|
||||
// Read key code
|
||||
if(digitalRead(UP) == LOW){
|
||||
keycode = 10; // Left swipe
|
||||
}
|
||||
else if(digitalRead(DOWN) == LOW){
|
||||
keycode = 9; // Right swipe
|
||||
}
|
||||
else if(digitalRead(CONF) == LOW){
|
||||
keycode = 3; // Key 3
|
||||
}
|
||||
else if(digitalRead(MENUE) == LOW){
|
||||
keycode = 1; // Key 1
|
||||
}
|
||||
else if(digitalRead(EXIT) == LOW){
|
||||
keycode = 2; // Key 2
|
||||
}
|
||||
else{
|
||||
keycode = 0; // No key activ
|
||||
}
|
||||
// Raed pad values
|
||||
readSensorpads();
|
||||
|
||||
// Detect key
|
||||
if (keycode > 0 ){
|
||||
@@ -253,6 +282,7 @@ void initKeys(CommonData &commonData) {
|
||||
keystatus = keycode;
|
||||
// Copy keycode
|
||||
keycodeold = keycode;
|
||||
while(readSensorpads() > 0){} // Wait for pad lesease
|
||||
delay(keydelay);
|
||||
}
|
||||
}
|
||||
|
||||
205
lib/obp60task/PageSystem.cpp
Normal file
205
lib/obp60task/PageSystem.cpp
Normal file
@@ -0,0 +1,205 @@
|
||||
#ifdef BOARD_OBP60S3
|
||||
|
||||
#include "Pagedata.h"
|
||||
#include "OBP60Extensions.h"
|
||||
#include "images/logo64.xbm"
|
||||
#include <esp_clk.h>
|
||||
|
||||
#define STRINGIZE_IMPL(x) #x
|
||||
#define STRINGIZE(x) STRINGIZE_IMPL(x)
|
||||
#define VERSINFO STRINGIZE(GWDEVVERSION)
|
||||
|
||||
/*
|
||||
* Special system page, called directly with fast key sequence 5,4
|
||||
* Out of normal page order.
|
||||
*/
|
||||
|
||||
class PageSystem : public Page
|
||||
{
|
||||
uint64_t chipid;
|
||||
bool simulation;
|
||||
String buzzer_mode;
|
||||
uint8_t buzzer_power;
|
||||
String cpuspeed;
|
||||
String rtc_module;
|
||||
String gps_module;
|
||||
String env_module;
|
||||
|
||||
char mode = 'N'; // (N)ormal, (D)evice list
|
||||
|
||||
public:
|
||||
PageSystem(CommonData &common){
|
||||
commonData = &common;
|
||||
common.logger->logDebug(GwLog::LOG,"Instantiate PageSystem");
|
||||
chipid = ESP.getEfuseMac();
|
||||
simulation = common.config->getBool(common.config->useSimuData);
|
||||
buzzer_mode = common.config->getString(common.config->buzzerMode);
|
||||
buzzer_power = common.config->getInt(common.config->buzzerPower);
|
||||
cpuspeed = common.config->getString(common.config->cpuSpeed);
|
||||
env_module = common.config->getString(common.config->useEnvSensor);
|
||||
rtc_module = common.config->getString(common.config->useRTC);
|
||||
gps_module = common.config->getString(common.config->useGPS);
|
||||
}
|
||||
|
||||
virtual void setupKeys(){
|
||||
commonData->keydata[0].label = "EXIT";
|
||||
commonData->keydata[1].label = "MODE";
|
||||
commonData->keydata[2].label = "";
|
||||
commonData->keydata[3].label = "";
|
||||
commonData->keydata[4].label = "STBY";
|
||||
commonData->keydata[5].label = "ILUM";
|
||||
}
|
||||
|
||||
virtual int handleKey(int key){
|
||||
// do *NOT* handle key #1 this handled by obp60task as exit
|
||||
// Switch display mode
|
||||
commonData->logger->logDebug(GwLog::LOG, "System keyboard handler");
|
||||
if (key == 2) {
|
||||
if (mode == 'N') {
|
||||
mode = 'D';
|
||||
} else {
|
||||
mode = 'N';
|
||||
}
|
||||
if (hasFRAM) fram.write(FRAM_VOLTAGE_MODE, mode);
|
||||
return 0;
|
||||
}
|
||||
// grab cursor keys to disable page navigation
|
||||
if (key == 3 or key == 4) {
|
||||
return 0;
|
||||
}
|
||||
// Code for keylock
|
||||
if (key == 11) {
|
||||
commonData->keylock = !commonData->keylock;
|
||||
return 0;
|
||||
}
|
||||
return key;
|
||||
}
|
||||
|
||||
virtual void displayPage(PageData &pageData){
|
||||
GwConfigHandler *config = commonData->config;
|
||||
GwLog *logger = commonData->logger;
|
||||
|
||||
// Get config data
|
||||
String flashLED = config->getString(config->flashLED);
|
||||
|
||||
// Optical warning by limit violation (unused)
|
||||
if(String(flashLED) == "Limit Violation"){
|
||||
setBlinkingLED(false);
|
||||
setFlashLED(false);
|
||||
}
|
||||
|
||||
// Logging boat values
|
||||
LOG_DEBUG(GwLog::LOG,"Drawing at PageSystem");
|
||||
|
||||
// Draw page
|
||||
//***********************************************************
|
||||
|
||||
const uint16_t y0 = 120; // data table starts here
|
||||
|
||||
// Set display in partial refresh mode
|
||||
getdisplay().setPartialWindow(0, 0, getdisplay().width(), getdisplay().height()); // Set partial update
|
||||
|
||||
if (mode == 'N') {
|
||||
getdisplay().setFont(&Ubuntu_Bold12pt7b);
|
||||
getdisplay().setCursor(20, 50);
|
||||
getdisplay().print("System Information");
|
||||
|
||||
getdisplay().drawXBitmap(320, 25, logo64_bits, logo64_width, logo64_height, commonData->fgcolor);
|
||||
|
||||
getdisplay().setFont(&Ubuntu_Bold8pt7b);
|
||||
|
||||
char ssid[23];
|
||||
snprintf(ssid, 23, "MCUDEVICE-%04X%08X", (uint16_t)(chipid >> 32), (uint32_t)chipid);
|
||||
getdisplay().setCursor(20, 70);
|
||||
getdisplay().print(ssid);
|
||||
getdisplay().setCursor(20, 100);
|
||||
getdisplay().print("Press STBY for white page and standby");
|
||||
|
||||
getdisplay().setCursor(2, y0);
|
||||
getdisplay().print("Simulation:");
|
||||
getdisplay().setCursor(120, y0);
|
||||
getdisplay().print(simulation ? "on" : "off");
|
||||
|
||||
getdisplay().setCursor(202, y0);
|
||||
getdisplay().print("Wifi:");
|
||||
getdisplay().setCursor(300, y0);
|
||||
getdisplay().print(commonData->status.wifiApOn ? "On" : "Off");
|
||||
|
||||
getdisplay().setCursor(2, y0 + 16);
|
||||
getdisplay().print("Environment:");
|
||||
getdisplay().setCursor(120, y0 + 16);
|
||||
getdisplay().print(env_module);
|
||||
|
||||
getdisplay().setCursor(2, y0 + 32);
|
||||
getdisplay().print("Buzzer:");
|
||||
getdisplay().setCursor(120, y0 + 32);
|
||||
getdisplay().print(buzzer_mode);
|
||||
|
||||
getdisplay().setCursor(2, y0 + 48);
|
||||
getdisplay().print("CPU speed:");
|
||||
getdisplay().setCursor(120, y0 + 48);
|
||||
getdisplay().print(cpuspeed);
|
||||
getdisplay().print(" / ");
|
||||
int cpu_freq = esp_clk_cpu_freq() / 1000000;
|
||||
getdisplay().print(String(cpu_freq));
|
||||
|
||||
getdisplay().setCursor(2, y0 + 64);
|
||||
getdisplay().print("RTC:");
|
||||
getdisplay().setCursor(120, y0 + 64);
|
||||
getdisplay().print(rtc_module);
|
||||
|
||||
getdisplay().setCursor(202, y0 + 64);
|
||||
getdisplay().print("GPS:");
|
||||
getdisplay().setCursor(300, y0 + 64);
|
||||
getdisplay().print(gps_module);
|
||||
|
||||
getdisplay().setCursor(2, y0 + 80);
|
||||
getdisplay().print("FRAM:");
|
||||
getdisplay().setCursor(120, y0 + 80);
|
||||
getdisplay().print(hasFRAM ? "available" : "not found");
|
||||
|
||||
getdisplay().setCursor(2, y0 + 120);
|
||||
getdisplay().print("Firmware Version: ");
|
||||
getdisplay().print(VERSINFO);
|
||||
|
||||
|
||||
} else {
|
||||
// NMEA2000 device list
|
||||
getdisplay().setFont(&Ubuntu_Bold12pt7b);
|
||||
getdisplay().setCursor(20, 50);
|
||||
getdisplay().print("NMEA2000 device list");
|
||||
|
||||
getdisplay().setFont(&Ubuntu_Bold8pt7b);
|
||||
getdisplay().setCursor(20, 80);
|
||||
getdisplay().print("RxD: ");
|
||||
getdisplay().print(String(commonData->status.n2kRx));
|
||||
getdisplay().setCursor(20, 100);
|
||||
getdisplay().print("TxD: ");
|
||||
getdisplay().print(String(commonData->status.n2kTx));
|
||||
}
|
||||
|
||||
// Update display
|
||||
getdisplay().nextPage(); // Partial update (fast)
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
static Page* createPage(CommonData &common){
|
||||
return new PageSystem(common);
|
||||
}
|
||||
|
||||
/**
|
||||
* with the code below we make this page known to the PageTask
|
||||
* we give it a type (name) that can be selected in the config
|
||||
* we define which function is to be called
|
||||
* and we provide the number of user parameters we expect
|
||||
* this will be number of BoatValue pointers in pageData.values
|
||||
*/
|
||||
PageDescription registerPageSystem(
|
||||
"System", // Page name
|
||||
createPage, // Action
|
||||
0, // No bus values
|
||||
true // Headers are anabled so far
|
||||
);
|
||||
|
||||
#endif
|
||||
@@ -1,112 +0,0 @@
|
||||
#!/bin/perl -w
|
||||
#A tool to generate the part of config.json that deals with pages and fields.
|
||||
#DEPRECATED, moved to get_set.py
|
||||
die "Please use gen_set.py instead";
|
||||
#List of all pages and the number of parameters they expect.
|
||||
%NoOfFieldsPerPage=qw(
|
||||
ApparentWind 0
|
||||
XTETrack 0
|
||||
Battery2 0
|
||||
Battery 0
|
||||
BME280 0
|
||||
Clock 0
|
||||
DST810 0
|
||||
FourValues2 4
|
||||
FourValues 4
|
||||
Generator 0
|
||||
KeelPosition 0
|
||||
OneValue 1
|
||||
RollPitch 0
|
||||
RudderPosition 0
|
||||
Solar 0
|
||||
ThreeValues 3
|
||||
TwoValues 2
|
||||
Voltage 0
|
||||
White 0
|
||||
WindRose 0
|
||||
WindRoseFlex 6
|
||||
);
|
||||
# No changes needed beyond this point
|
||||
#max number of pages supported by OBP60
|
||||
$NoOfPages=10;
|
||||
#Default selection for each page
|
||||
@Defaults=qw(Voltage WindRose OneValue TwoValues ThreeValues FourValues FourValues2 Clock RollPitch Battery2);
|
||||
@Numbers=qw(one two three four five six seven eight nine ten);
|
||||
@Pages=sort(keys(%NoOfFieldsPerPage));
|
||||
$MaxNoOfFieldsPerPage=0; # inital value, gets updated with maximum entry from %NoOfFieldsPerPage
|
||||
|
||||
|
||||
#find max. number of fields without additional modules
|
||||
foreach (values(%NoOfFieldsPerPage)){
|
||||
if ($_ > $MaxNoOfFieldsPerPage){
|
||||
$MaxNoOfFieldsPerPage=$_;
|
||||
}
|
||||
}
|
||||
|
||||
for ($PageNo=1;$PageNo<=$NoOfPages;$PageNo++){
|
||||
print "{\n";
|
||||
print "\t","\"name\": \"page", $PageNo,"type\",\n";
|
||||
print "\t","\"label\": \"Type\",\n";
|
||||
print "\t",'"type": "list",',"\n";
|
||||
print "\t",'"default": "';
|
||||
print "$Defaults[$PageNo-1]";
|
||||
print'"',"\n";
|
||||
print "\t",'"description": "Type of page for page ',$PageNo,'",',"\n";
|
||||
print "\t",'"list": [';
|
||||
for ($p=0;$p<=$#Pages;$p++) {
|
||||
print '"', $Pages[$p], '"' ;
|
||||
if ($p < $#Pages){print ","}
|
||||
}
|
||||
print "]\n";
|
||||
print "\t",'"category": "OBP60 Page ',$PageNo,'",',"\n";
|
||||
print "\t",'"capabilities": {',"\n";
|
||||
print "\t\t",'"obp60":"true"',"\n";
|
||||
print "\t",'}',"\n";
|
||||
print "\t",'"condition":[';
|
||||
for ($vp=$PageNo;$vp<=$NoOfPages;$vp++){
|
||||
print '"{visiblePages":"',$vp,'"},';
|
||||
}
|
||||
print "\b",']',"\n";
|
||||
print '},',"\n";
|
||||
for ($FieldNo=1; $FieldNo<=$MaxNoOfFieldsPerPage;$FieldNo++){
|
||||
print "{\n";
|
||||
print "\t",'"name": "page',$PageNo,'value',$FieldNo,'",',"\n";
|
||||
print "\t",'"label": "Field ',$FieldNo,'",',"\n";
|
||||
print "\t",'"type": "boatData",',"\n";
|
||||
print "\t",'"default": "",',"\n";
|
||||
print "\t",'"description": "The display for field ',$Numbers[$FieldNo-1],'",',"\n";
|
||||
print "\t",'"category": "OBP60 Page ',$PageNo,'",',"\n";
|
||||
print "\t",'"capabilities": {',"\n";
|
||||
print "\t",' "obp60":"true"',"\n";
|
||||
print "\t",'}, ',"\n";
|
||||
print "\t",'"condition":[';
|
||||
foreach $page (@Pages) {
|
||||
if($NoOfFieldsPerPage{$page}>=$FieldNo){
|
||||
print '{"page',$PageNo,'type":"',$page,'"},';
|
||||
}
|
||||
}
|
||||
print "\b],\n";
|
||||
print '},',"\n";
|
||||
}
|
||||
print "{\n";
|
||||
print "\t","\"name\": \"page", $PageNo,"fluid\",\n";
|
||||
print "\t",'"label": "Fluid type",',"\n";
|
||||
print "\t",'"type": "list",',"\n";
|
||||
print "\t",'"default": "0",',"\n";
|
||||
print "\t",'"list": [',"\n";
|
||||
print "\t",'{"l":"Fuel (0)","v":"0"},',"\n";
|
||||
print "\t",'{"l":"Water (1)","v":"1"},',"\n";
|
||||
print "\t",'{"l":"Gray Water (2)","v":"2"},',"\n";
|
||||
print "\t",'{"l":"Live Well (3)","v":"3"},',"\n";
|
||||
print "\t",'{"l":"Oil (4)","v":"4"},',"\n";
|
||||
print "\t",'{"l":"Black Water (5)","v":"5"},',"\n";
|
||||
print "\t",'{"l":"Fuel Gasoline (6)","v":"6"}',"\n";
|
||||
print "\t",'],',"\n";
|
||||
print "\t",'"description": "Fluid type in tank",',"\n";
|
||||
print "\t",'"category": "OBP60 Page ',$PageNo,'",',"\n";
|
||||
print "\t",'"capabilities": {',"\n";
|
||||
print "\t",'"obp60":"true"',"\n";
|
||||
print "\t",'},',"\n";
|
||||
print "\t",'"condition":[{"page',$PageNo,'type":"Fluid"}]',"\n";
|
||||
print '},',"\n";
|
||||
}
|
||||
@@ -1,18 +1,22 @@
|
||||
#!/usr/bin/env python3
|
||||
# A tool to generate that part of config.json that deals with pages and fields.
|
||||
#
|
||||
#Usage: 1. modify this script (e.g.add a page, change number of fields, etc.)
|
||||
# 2. Delete all lines from config.json from the curly backet before "name": "page1type" to o the end of the file (as of today, delete from line 917 to the end of the File)
|
||||
# 3. run ./gen_set.py >> config.json
|
||||
|
||||
import json
|
||||
|
||||
# List of all pages and the number of parameters they expect.
|
||||
no_of_fields_per_page = {
|
||||
"ApparentWind": 0,
|
||||
"Wind": 0,
|
||||
"XTETrack": 0,
|
||||
"Battery2": 0,
|
||||
"Battery": 0,
|
||||
"BME280": 0,
|
||||
"Clock": 0,
|
||||
"DST810": 0,
|
||||
"Fluid": 0,
|
||||
"Fluid": 1,
|
||||
"FourValues2": 4,
|
||||
"FourValues": 4,
|
||||
"Generator": 0,
|
||||
@@ -27,6 +31,7 @@ no_of_fields_per_page = {
|
||||
"White": 0,
|
||||
"WindRose": 0,
|
||||
"WindRoseFlex": 6,
|
||||
"SixValues" : 6,
|
||||
}
|
||||
|
||||
# No changes needed beyond this point
|
||||
@@ -119,5 +124,7 @@ for page_no in range(1, no_of_pages + 1):
|
||||
|
||||
json_output = json.dumps(output, indent=4)
|
||||
# print omitting first and last line containing [ ] of JSON array
|
||||
print(json_output[1:-1])
|
||||
#print(json_output[1:-1])
|
||||
# print omitting first line containing [ of JSON array
|
||||
print(json_output[1:])
|
||||
# print(",")
|
||||
51
lib/obp60task/images/logo64.xbm
Normal file
51
lib/obp60task/images/logo64.xbm
Normal file
@@ -0,0 +1,51 @@
|
||||
#ifndef _LOGO64_XBM_
|
||||
#define _LOGO64_XBM_ 1
|
||||
|
||||
#define logo64_width 64
|
||||
#define logo64_height 64
|
||||
static unsigned char logo64_bits[] PROGMEM = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff,
|
||||
0x00, 0x00, 0x00, 0xc1, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x80, 0xc1,
|
||||
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xc0, 0xc1, 0x7f, 0xf8, 0x01, 0xfe,
|
||||
0x00, 0x00, 0xc0, 0xc1, 0x1f, 0xe0, 0x01, 0xfc, 0x00, 0x00, 0xe0, 0xc1,
|
||||
0x0f, 0xc3, 0xf1, 0xf8, 0x00, 0x00, 0xf0, 0xc1, 0xc7, 0x8f, 0xf1, 0xf9,
|
||||
0x00, 0x00, 0xf8, 0xc1, 0xc7, 0x8f, 0xf1, 0xf9, 0x00, 0x00, 0xf8, 0xc1,
|
||||
0xe7, 0x9f, 0xf1, 0xf8, 0x00, 0x00, 0xfc, 0xc1, 0xe7, 0x9f, 0x01, 0xfc,
|
||||
0x00, 0x00, 0xfe, 0xc1, 0xe7, 0x9f, 0x01, 0xfe, 0x00, 0x00, 0xfe, 0xc1,
|
||||
0xc7, 0x8f, 0xf1, 0xff, 0x00, 0x00, 0xff, 0xc1, 0xc7, 0x8f, 0xf1, 0xff,
|
||||
0x00, 0x80, 0xff, 0xc1, 0x8f, 0xc7, 0xf1, 0xff, 0x00, 0x80, 0xff, 0xc1,
|
||||
0x1f, 0xe0, 0xf1, 0xff, 0x00, 0xc0, 0xff, 0xc1, 0x7f, 0xf8, 0xf1, 0xff,
|
||||
0x00, 0xe0, 0xff, 0xc1, 0xff, 0xff, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xc1,
|
||||
0xff, 0xff, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xc1, 0xff, 0xff, 0xff, 0xff,
|
||||
0x00, 0xf8, 0xff, 0xc1, 0x0f, 0xe0, 0xf8, 0xfc, 0x00, 0xfc, 0xff, 0xc1,
|
||||
0x0f, 0xe0, 0xf8, 0xfc, 0x00, 0xfc, 0xff, 0xc1, 0xcf, 0xff, 0xf0, 0xfc,
|
||||
0x00, 0xfe, 0xff, 0xc1, 0xcf, 0xff, 0xe0, 0xfc, 0x00, 0xff, 0xff, 0xc1,
|
||||
0xcf, 0xff, 0xe4, 0xfc, 0x00, 0xff, 0xff, 0xc1, 0x0f, 0xe0, 0xc4, 0xfc,
|
||||
0x80, 0xff, 0xff, 0xc1, 0x0f, 0xe0, 0xcc, 0xfc, 0xc0, 0xff, 0xff, 0xc1,
|
||||
0xcf, 0xff, 0x8c, 0xfc, 0xe0, 0xff, 0xff, 0xc1, 0xcf, 0xff, 0x9c, 0xfc,
|
||||
0xe0, 0xff, 0xff, 0xc1, 0xcf, 0xff, 0x1c, 0xfc, 0xf0, 0xff, 0xff, 0xc1,
|
||||
0xcf, 0xff, 0x3c, 0xfc, 0xf8, 0xff, 0xff, 0xc1, 0x0f, 0xe0, 0x7c, 0xfc,
|
||||
0xf8, 0xff, 0xff, 0xc1, 0x0f, 0xe0, 0xfc, 0xfc, 0xfc, 0xff, 0xff, 0xc1,
|
||||
0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xc1, 0xff, 0xff, 0xff, 0xff,
|
||||
0xfe, 0xff, 0xff, 0xc1, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x3c, 0x00, 0x00, 0x38, 0x00, 0x04, 0x00, 0x00, 0x44, 0x00, 0x10, 0x48,
|
||||
0x00, 0x00, 0x00, 0x01, 0x44, 0x86, 0x7b, 0x48, 0x67, 0xc4, 0xf0, 0x77,
|
||||
0x3c, 0x09, 0x12, 0x38, 0x91, 0x24, 0x09, 0x11, 0x44, 0xc9, 0x13, 0x08,
|
||||
0x91, 0xe4, 0x09, 0x61, 0x44, 0x49, 0x12, 0x08, 0x91, 0x24, 0x08, 0x41,
|
||||
0x3c, 0xc6, 0x73, 0x08, 0x61, 0xc4, 0x71, 0x77, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
|
||||
#endif
|
||||
171
lib/obp60task/images/unknown.xbm
Normal file
171
lib/obp60task/images/unknown.xbm
Normal file
@@ -0,0 +1,171 @@
|
||||
#ifndef _UNKNOWN_XBM_
|
||||
#define _UNKNOWN_XBM_ 1
|
||||
|
||||
#define unknown_width 120
|
||||
#define unknown_height 130
|
||||
static unsigned char unknown_bits[] PROGMEM = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x03, 0x00, 0x00, 0xe0, 0xff, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x70, 0x80, 0xcf, 0x01, 0x00, 0x00,
|
||||
0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xf7, 0xc0, 0x7f,
|
||||
0x00, 0x00, 0xc0, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x80,
|
||||
0xff, 0xfb, 0x7b, 0x00, 0x00, 0xf8, 0x7f, 0xe0, 0x0f, 0x00, 0x00, 0x00,
|
||||
0x00, 0xfc, 0x07, 0xb8, 0xff, 0xfb, 0x7f, 0x00, 0xff, 0x3f, 0xf8, 0x1f,
|
||||
0x00, 0x00, 0x00, 0x00, 0x9c, 0x0f, 0xd0, 0xff, 0xfd, 0x19, 0xe0, 0xff,
|
||||
0x0d, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf0, 0xf9, 0x3f,
|
||||
0x0d, 0xfc, 0x7f, 0x86, 0xff, 0x07, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x07,
|
||||
0xfe, 0xc1, 0xdf, 0x07, 0xff, 0xc1, 0xe3, 0x3d, 0x03, 0x00, 0x00, 0x3f,
|
||||
0x00, 0x00, 0x07, 0x7e, 0x81, 0xff, 0x84, 0x7f, 0xf3, 0x7b, 0x07, 0x03,
|
||||
0x00, 0x00, 0x7e, 0x80, 0x3f, 0x0f, 0xf0, 0xc3, 0x3b, 0xe4, 0xdd, 0x9d,
|
||||
0xcf, 0x80, 0x01, 0x00, 0x00, 0x6c, 0x00, 0xff, 0x3f, 0xe0, 0x17, 0x9c,
|
||||
0x7f, 0xf7, 0xc3, 0x63, 0x80, 0x01, 0x00, 0x00, 0xfe, 0x0c, 0xf0, 0xfd,
|
||||
0xc3, 0x3c, 0xde, 0xfd, 0xef, 0xf8, 0x18, 0x80, 0x01, 0x00, 0x00, 0xfe,
|
||||
0x0e, 0xf0, 0x9f, 0x8f, 0x78, 0xcf, 0xfe, 0x1b, 0x3f, 0x0e, 0xc0, 0x00,
|
||||
0x00, 0x00, 0xfe, 0x1d, 0xf0, 0xff, 0x9f, 0x21, 0xcc, 0xfb, 0xe7, 0x8f,
|
||||
0x03, 0xc0, 0x00, 0x00, 0x00, 0xcc, 0x1f, 0xb0, 0xff, 0x1f, 0x00, 0xc0,
|
||||
0xbf, 0xb9, 0xc7, 0x01, 0xc0, 0x00, 0x00, 0x00, 0xfc, 0x1f, 0x3c, 0x1f,
|
||||
0xfe, 0x00, 0xfe, 0x6f, 0xfe, 0xf1, 0x01, 0xc0, 0x00, 0x00, 0xf8, 0xfb,
|
||||
0x1f, 0xbc, 0xfe, 0xff, 0xc0, 0xff, 0x9d, 0x7f, 0x7c, 0x00, 0x60, 0x00,
|
||||
0x00, 0xfc, 0xef, 0x1d, 0xfc, 0xc3, 0xff, 0xe9, 0xcf, 0xed, 0x1f, 0x1f,
|
||||
0x00, 0x60, 0x00, 0x00, 0xfe, 0xef, 0x1d, 0x00, 0x97, 0xf0, 0xf9, 0xcf,
|
||||
0xfd, 0x87, 0x07, 0x03, 0x60, 0x00, 0x00, 0xfe, 0xcc, 0x0c, 0x00, 0xfc,
|
||||
0x81, 0xff, 0xdf, 0xfd, 0xc0, 0xf9, 0x03, 0x60, 0x00, 0x00, 0xe4, 0xdc,
|
||||
0x0f, 0x00, 0xf8, 0x9f, 0xff, 0xdf, 0x3d, 0xe0, 0x0f, 0x00, 0x60, 0x00,
|
||||
0x00, 0xc0, 0xdf, 0x03, 0x00, 0xe0, 0xf1, 0xfe, 0xdf, 0x0c, 0xfe, 0xff,
|
||||
0x01, 0x60, 0x00, 0x00, 0xc0, 0xcf, 0x01, 0x00, 0x60, 0xf3, 0xff, 0xdb,
|
||||
0x06, 0xff, 0x01, 0x00, 0x70, 0x00, 0x00, 0x00, 0x8f, 0x01, 0x00, 0x78,
|
||||
0xff, 0x1f, 0x9b, 0x87, 0xff, 0xff, 0x0f, 0x30, 0x00, 0x00, 0x00, 0x66,
|
||||
0x03, 0x00, 0xfc, 0x7f, 0xfb, 0x99, 0xc7, 0xff, 0xff, 0x00, 0x30, 0x00,
|
||||
0x00, 0x00, 0x06, 0x03, 0x00, 0xc6, 0xff, 0xff, 0xd9, 0x67, 0xff, 0xc1,
|
||||
0x01, 0x70, 0x00, 0x00, 0x00, 0xc7, 0x03, 0x00, 0x07, 0x7c, 0xe3, 0xf9,
|
||||
0xe3, 0xff, 0x7f, 0x00, 0x70, 0x00, 0x00, 0x80, 0xf3, 0x07, 0x00, 0x1f,
|
||||
0x6c, 0xe0, 0x7b, 0xe3, 0xff, 0xff, 0x01, 0x70, 0x00, 0x00, 0x80, 0xd9,
|
||||
0x06, 0x80, 0xff, 0x0f, 0xce, 0xef, 0xe3, 0xff, 0xf7, 0x01, 0x70, 0x00,
|
||||
0x00, 0xe0, 0xbf, 0x0d, 0xc0, 0xff, 0x43, 0xe4, 0xef, 0xe3, 0x3f, 0x7f,
|
||||
0x07, 0x60, 0x00, 0x00, 0xe0, 0xbf, 0x1d, 0xe0, 0x78, 0x43, 0x70, 0xec,
|
||||
0xe1, 0xff, 0xf8, 0x1d, 0x60, 0x00, 0x00, 0xe0, 0xff, 0x19, 0x70, 0x00,
|
||||
0x03, 0x37, 0xfc, 0xf1, 0xbf, 0xc3, 0x07, 0x60, 0x00, 0x00, 0xc0, 0xff,
|
||||
0x19, 0x70, 0x80, 0x01, 0x3b, 0xd6, 0xf9, 0xef, 0x1c, 0x3e, 0x60, 0x00,
|
||||
0x00, 0x80, 0x63, 0x1b, 0xf0, 0xc6, 0x39, 0x19, 0xfe, 0xf8, 0xbf, 0x31,
|
||||
0xf8, 0x60, 0x00, 0x00, 0x00, 0x60, 0x3b, 0xf8, 0xfe, 0x98, 0x1f, 0xfe,
|
||||
0xf8, 0x7f, 0x67, 0xe0, 0x61, 0x00, 0x00, 0x00, 0x60, 0x33, 0xfc, 0x7f,
|
||||
0x80, 0x0f, 0xeb, 0xfc, 0xff, 0x0d, 0x80, 0xc7, 0x00, 0x00, 0x00, 0x60,
|
||||
0x33, 0x0c, 0x7f, 0x06, 0x0c, 0x7f, 0xec, 0x6f, 0x0b, 0x00, 0xfe, 0x00,
|
||||
0x00, 0x00, 0x60, 0x76, 0x0e, 0xf8, 0xbf, 0x87, 0x7f, 0xee, 0xdf, 0x00,
|
||||
0x00, 0xf8, 0x01, 0x00, 0x00, 0xc0, 0x76, 0x0e, 0xb8, 0xa0, 0x87, 0x3f,
|
||||
0xde, 0x3f, 0x01, 0x00, 0xf0, 0x03, 0x00, 0x00, 0xc0, 0xf6, 0x0f, 0x3c,
|
||||
0x80, 0xdf, 0x3f, 0xdf, 0x77, 0x02, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0,
|
||||
0xdd, 0xef, 0x1f, 0x80, 0xfe, 0x9f, 0xdf, 0xe7, 0x06, 0x00, 0xe0, 0x03,
|
||||
0x00, 0x00, 0x80, 0xfd, 0xfe, 0x1f, 0xcc, 0xff, 0xdf, 0xdf, 0xee, 0x18,
|
||||
0x00, 0xf0, 0x03, 0x00, 0x00, 0x80, 0xfd, 0xff, 0x1b, 0xdc, 0xf6, 0xcf,
|
||||
0xdf, 0xc0, 0x19, 0x00, 0x70, 0x00, 0x00, 0x00, 0x80, 0x7f, 0x03, 0x98,
|
||||
0x01, 0xb6, 0xcf, 0x93, 0x80, 0x33, 0x00, 0x30, 0x00, 0x00, 0x00, 0x80,
|
||||
0x7f, 0x01, 0x1c, 0xc0, 0xfe, 0xff, 0x9f, 0x00, 0x03, 0x00, 0x30, 0x00,
|
||||
0x00, 0x00, 0x80, 0x9f, 0x01, 0x0c, 0xc0, 0xff, 0xe7, 0x9b, 0x01, 0x06,
|
||||
0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0xff, 0x0f, 0x0e, 0xcc, 0xff, 0xe3,
|
||||
0xbb, 0x01, 0x0c, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0xff, 0xcf, 0x07,
|
||||
0x8c, 0xff, 0xf9, 0xbb, 0x01, 0x18, 0x00, 0x18, 0x00, 0x00, 0x00, 0x80,
|
||||
0xbf, 0xff, 0xcf, 0x1f, 0xdf, 0xfd, 0xbb, 0x09, 0x38, 0x00, 0x1c, 0x00,
|
||||
0x00, 0x00, 0x80, 0xfb, 0xff, 0x8d, 0xdf, 0x6f, 0xfc, 0xbb, 0x01, 0x70,
|
||||
0x00, 0x0c, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x8f, 0xff, 0x3f, 0xff,
|
||||
0xbb, 0x01, 0x60, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0xef, 0xe0, 0x8f,
|
||||
0xbf, 0x1f, 0xbf, 0xab, 0x09, 0xe0, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00,
|
||||
0xff, 0xf0, 0x8d, 0xd6, 0xc3, 0xbb, 0xab, 0x01, 0xc0, 0x01, 0x0e, 0x00,
|
||||
0x00, 0x00, 0x00, 0x7f, 0x31, 0x00, 0x7e, 0xe0, 0x39, 0xab, 0x19, 0x80,
|
||||
0x03, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x66, 0x19, 0x80, 0x79, 0x7c, 0x3c,
|
||||
0xa9, 0x01, 0x00, 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x19, 0x80,
|
||||
0x6d, 0x7e, 0x1c, 0xb1, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00, 0x00, 0x00,
|
||||
0xe0, 0x1f, 0x80, 0x0d, 0x1c, 0x10, 0xb1, 0x01, 0x00, 0x06, 0x0e, 0x00,
|
||||
0x00, 0x00, 0x00, 0xc0, 0x3f, 0x10, 0x00, 0x38, 0x00, 0xb1, 0x01, 0x00,
|
||||
0x0e, 0x06, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3d, 0xb3, 0x00, 0x3b, 0x00,
|
||||
0xa1, 0x01, 0x00, 0x0c, 0x06, 0x00, 0x00, 0x00, 0x00, 0x80, 0xe7, 0xf1,
|
||||
0xd8, 0x7f, 0x03, 0xb1, 0x01, 0x00, 0x1c, 0x06, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0xc3, 0xfb, 0xf0, 0x7f, 0x01, 0xb1, 0x01, 0x00, 0x18, 0x06, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x83, 0xfb, 0xf0, 0x7f, 0x01, 0xb1, 0x01, 0x00,
|
||||
0x18, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0x01, 0x7f, 0x00,
|
||||
0x80, 0x01, 0x00, 0x30, 0x06, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x3f,
|
||||
0x01, 0xff, 0x07, 0x80, 0x01, 0x00, 0x30, 0x06, 0x00, 0x00, 0x00, 0x00,
|
||||
0xc0, 0xfd, 0x1d, 0x01, 0xfb, 0x3f, 0x80, 0x01, 0x00, 0x70, 0x06, 0x00,
|
||||
0x00, 0x00, 0x00, 0xc0, 0xf0, 0xde, 0x67, 0x18, 0x7f, 0x80, 0x01, 0x00,
|
||||
0x60, 0x07, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x78, 0xcf, 0x0f, 0x86, 0xfd,
|
||||
0x81, 0x01, 0x00, 0x65, 0x07, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xaf, 0xbf,
|
||||
0x3d, 0x80, 0xf9, 0x81, 0x01, 0xf8, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00,
|
||||
0xe0, 0xaf, 0xff, 0x78, 0x00, 0xe0, 0x83, 0x01, 0x7f, 0xf8, 0x01, 0x00,
|
||||
0x00, 0x00, 0x00, 0x70, 0xfe, 0x7f, 0x70, 0x20, 0x6c, 0x87, 0xe0, 0x07,
|
||||
0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x30, 0xf8, 0x0f, 0xf0, 0x30, 0x06,
|
||||
0xcf, 0xf8, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xdb, 0x0e,
|
||||
0xd8, 0x00, 0x30, 0xcf, 0x3c, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0xf8, 0xfb, 0x38, 0xfc, 0x01, 0x20, 0xcc, 0x0f, 0x00, 0x60, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x1c, 0x3e, 0xf8, 0xbf, 0x03, 0x06, 0xfd, 0x03, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x1e, 0xf8, 0xdf, 0x0f, 0x02,
|
||||
0xff, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x0f, 0xf0,
|
||||
0x07, 0x3e, 0x30, 0xfa, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00,
|
||||
0xfe, 0x07, 0x00, 0x03, 0x78, 0x30, 0xfb, 0x03, 0x00, 0x80, 0x03, 0x00,
|
||||
0x00, 0x00, 0x00, 0xff, 0x06, 0x00, 0xc3, 0xff, 0x00, 0xff, 0x1f, 0x00,
|
||||
0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x03, 0x00, 0xbf, 0xdf, 0x01,
|
||||
0xfe, 0x1f, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x01, 0x00,
|
||||
0xfe, 0x8f, 0x83, 0xef, 0x0f, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x80,
|
||||
0xef, 0x00, 0x00, 0xf8, 0x03, 0x83, 0xb1, 0x03, 0x00, 0x60, 0x03, 0x00,
|
||||
0x00, 0xe0, 0x80, 0x61, 0x00, 0x00, 0x80, 0x01, 0x04, 0xb0, 0x03, 0x03,
|
||||
0x30, 0x03, 0x00, 0x00, 0xfc, 0xc1, 0x30, 0x06, 0x00, 0x80, 0x01, 0x1e,
|
||||
0xa0, 0x87, 0x03, 0x30, 0x03, 0x00, 0x00, 0x7e, 0xff, 0xb8, 0x0f, 0x00,
|
||||
0x80, 0x8b, 0x1f, 0x04, 0x86, 0x03, 0x18, 0x03, 0x00, 0x00, 0xf6, 0x7f,
|
||||
0xf8, 0x3f, 0x00, 0x80, 0xff, 0x77, 0xfe, 0x86, 0x07, 0x0e, 0x01, 0x00,
|
||||
0x00, 0xfe, 0x19, 0x00, 0x76, 0x00, 0x00, 0xff, 0x63, 0xf6, 0x86, 0xfd,
|
||||
0x87, 0x01, 0x00, 0x00, 0xf6, 0x0f, 0x00, 0x7e, 0x00, 0x00, 0xfc, 0x60,
|
||||
0x00, 0x8c, 0xf3, 0x81, 0x01, 0x00, 0x00, 0x06, 0x06, 0xfe, 0x7c, 0x00,
|
||||
0x00, 0x70, 0xc0, 0x00, 0x8e, 0x07, 0x83, 0x01, 0x00, 0x00, 0xf8, 0xb3,
|
||||
0xff, 0x7f, 0x00, 0x00, 0x60, 0xc0, 0x9c, 0x0f, 0xff, 0xc1, 0x00, 0x00,
|
||||
0x00, 0xfc, 0xd9, 0x03, 0x3f, 0x00, 0x00, 0xe0, 0xc0, 0x80, 0x0d, 0x7e,
|
||||
0xc0, 0x00, 0x00, 0x00, 0x0e, 0xde, 0x00, 0x1c, 0x00, 0x00, 0xe0, 0xff,
|
||||
0x01, 0xfc, 0x0f, 0xc0, 0x00, 0x00, 0x00, 0xde, 0xdf, 0x00, 0x00, 0x00,
|
||||
0x00, 0xfe, 0xbf, 0x03, 0xfc, 0x00, 0x66, 0x00, 0x00, 0x00, 0xda, 0xcc,
|
||||
0x00, 0x00, 0x00, 0xc0, 0xff, 0x0f, 0x62, 0x1f, 0x00, 0x67, 0x00, 0x00,
|
||||
0x00, 0x7e, 0xcc, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x03, 0xe3, 0x5f, 0xc1,
|
||||
0x33, 0x00, 0x00, 0x00, 0x3e, 0x8e, 0x01, 0x00, 0x00, 0xf8, 0xf1, 0x03,
|
||||
0x06, 0xfc, 0x7f, 0x33, 0x00, 0x00, 0x00, 0x0e, 0xde, 0x00, 0x00, 0x00,
|
||||
0x6e, 0xc0, 0x07, 0x0e, 0xfc, 0x1f, 0x13, 0x00, 0x00, 0x00, 0x1e, 0x7c,
|
||||
0x00, 0x00, 0x00, 0x1f, 0xe2, 0x3f, 0xef, 0x7f, 0x00, 0x1b, 0x00, 0x00,
|
||||
0x00, 0x1c, 0x6c, 0x02, 0x00, 0x80, 0x07, 0xf8, 0xff, 0x47, 0x0c, 0x80,
|
||||
0x19, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x03, 0x00, 0xc0, 0x03, 0xfb, 0xff,
|
||||
0x0d, 0x0c, 0x80, 0x19, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x03, 0x00, 0x60,
|
||||
0x40, 0x3f, 0x18, 0x4c, 0x3d, 0x80, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xf0,
|
||||
0x01, 0x00, 0x70, 0x40, 0x1f, 0x18, 0xfc, 0x37, 0x80, 0x0b, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0xb8, 0xb0, 0x1f, 0x18, 0x0c, 0x3e, 0x80,
|
||||
0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0xc8, 0x08, 0x78,
|
||||
0x2c, 0x06, 0x00, 0xdf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
|
||||
0x60, 0x00, 0xf8, 0xcf, 0x06, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x0c, 0x35, 0x00, 0xf8, 0x9f, 0x06, 0x00, 0xfe, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x36, 0x00, 0xf8, 0x77, 0x03, 0x00,
|
||||
0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x31, 0x00, 0xd8,
|
||||
0xdd, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c,
|
||||
0x1a, 0x00, 0x08, 0x0c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0xce, 0x1e, 0x00, 0x0c, 0xfe, 0x03, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0xee, 0x18, 0x00, 0x0c, 0x8c, 0x01, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xce, 0x1f, 0x00, 0x7c,
|
||||
0xef, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xce,
|
||||
0x1e, 0x00, 0xf8, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0xce, 0xf0, 0x03, 0xfc, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0xde, 0xfb, 0x01, 0x0c, 0x5f, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbe, 0xef, 0x01, 0x06,
|
||||
0x7d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e,
|
||||
0xd7, 0x81, 0x87, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x3c, 0xdf, 0xc3, 0xc7, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0xfe, 0xff, 0xff, 0x3b, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0xfc, 0x7f, 0xfe,
|
||||
0x3d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8,
|
||||
0xfd, 0x7f, 0xfc, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x80, 0x37, 0xe6, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xf7, 0xe3, 0xff, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x3f,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0xfe, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0xfe, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
|
||||
#endif
|
||||
@@ -20,10 +20,10 @@
|
||||
//#include GxEPD_BitmapExamples // Example picture
|
||||
#include "MFD_OBP60_400x300_sw.h" // MFD with logo
|
||||
#include "Logo_OBP_400x300_sw.h" // OBP Logo
|
||||
#include "images/unknown.xbm" // unknown page indicator
|
||||
#include "OBP60QRWiFi.h" // Functions lib for WiFi QR code
|
||||
#include "OBPSensorTask.h" // Functions lib for sensor data
|
||||
|
||||
#include "LedSpiTask.h"
|
||||
|
||||
// Global vars
|
||||
bool initComplete = false; // Initialization complete
|
||||
@@ -127,7 +127,7 @@ void keyboardTask(void *param){
|
||||
|
||||
// Loop for keyboard task
|
||||
while (true){
|
||||
keycode = readKeypad(data->sensitivity);
|
||||
keycode = readKeypad(data->logger, data->sensitivity);
|
||||
//send a key event
|
||||
if(keycode != 0){
|
||||
xQueueSend(data->queue, &keycode, 0);
|
||||
@@ -204,8 +204,10 @@ void registerAllPages(PageList &list){
|
||||
//this way this separate source file can be compiled by it's own
|
||||
//and has no access to any of our data except the one that we
|
||||
//give as a parameter to the page function
|
||||
extern PageDescription registerPageOneValue;
|
||||
extern PageDescription registerPageSystem;
|
||||
//we add the variable to our list
|
||||
list.add(®isterPageSystem);
|
||||
extern PageDescription registerPageOneValue;
|
||||
list.add(®isterPageOneValue);
|
||||
extern PageDescription registerPageTwoValues;
|
||||
list.add(®isterPageTwoValues);
|
||||
@@ -406,6 +408,8 @@ void OBP60Task(GwApi *api){
|
||||
pages[i].parameters.values.push_back(value);
|
||||
}
|
||||
}
|
||||
// add out of band system page (always available)
|
||||
Page *syspage = allPages.pages[0]->creator(commonData);
|
||||
|
||||
// Display screenshot handler for HTTP request
|
||||
// http://192.168.15.1/api/user/OBP60Task/screenshot
|
||||
@@ -467,11 +471,11 @@ void OBP60Task(GwApi *api){
|
||||
|
||||
// Main loop runs with 100ms
|
||||
//####################################################################################
|
||||
|
||||
|
||||
bool systemPage = false;
|
||||
while (true){
|
||||
delay(100); // Delay 100ms (loop time)
|
||||
|
||||
|
||||
// Undervoltage detection
|
||||
if(uvoltage == true){
|
||||
underVoltageDetection(api, commonData);
|
||||
@@ -512,12 +516,27 @@ void OBP60Task(GwApi *api){
|
||||
int keyboardMessage=0;
|
||||
while (xQueueReceive(allParameters.queue,&keyboardMessage,0)){
|
||||
LOG_DEBUG(GwLog::LOG,"new key from keyboard %d",keyboardMessage);
|
||||
|
||||
Page *currentPage=pages[pageNumber].page;
|
||||
if (currentPage ){
|
||||
keyboardMessage=currentPage->handleKey(keyboardMessage);
|
||||
|
||||
Page *currentPage;
|
||||
if (keyboardMessage == 12) {
|
||||
LOG_DEBUG(GwLog::LOG, "Calling system page");
|
||||
systemPage = true; // System page is out of band
|
||||
syspage->setupKeys();
|
||||
}
|
||||
if (keyboardMessage > 0)
|
||||
else {
|
||||
currentPage = pages[pageNumber].page;
|
||||
if (systemPage && keyboardMessage == 1) {
|
||||
// exit system mode with exit key number 1
|
||||
systemPage = false;
|
||||
currentPage->setupKeys();
|
||||
}
|
||||
}
|
||||
if (systemPage) {
|
||||
keyboardMessage = syspage->handleKey(keyboardMessage);
|
||||
} else if (currentPage) {
|
||||
keyboardMessage = currentPage->handleKey(keyboardMessage);
|
||||
}
|
||||
if (keyboardMessage > 0) // not handled by page
|
||||
{
|
||||
// Decoding all key codes
|
||||
// #6 Backlight on if key controled
|
||||
@@ -573,8 +592,7 @@ void OBP60Task(GwApi *api){
|
||||
}
|
||||
else{
|
||||
setBacklightLED(0, COLOR_BLUE); // Backlight LEDs off (blue without britghness)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -631,36 +649,53 @@ void OBP60Task(GwApi *api){
|
||||
api->getBoatDataValues(boatValues.numValues,boatValues.allBoatValues);
|
||||
api->getStatus(commonData.status);
|
||||
|
||||
// Clear display
|
||||
// getdisplay().fillRect(0, 0, getdisplay().width(), getdisplay().height(), commonData.bgcolor);
|
||||
getdisplay().fillScreen(commonData.bgcolor); // Clear display
|
||||
|
||||
// Show header if enabled
|
||||
getdisplay().fillRect(0, 0, getdisplay().width(), getdisplay().height(), commonData.bgcolor); // Clear display
|
||||
if (pages[pageNumber].description && pages[pageNumber].description->header){
|
||||
if (pages[pageNumber].description && pages[pageNumber].description->header or systemPage){
|
||||
// build header using commonData
|
||||
getdisplay().fillScreen(commonData.bgcolor); // Clear display
|
||||
displayHeader(commonData, date, time, hdop); // Show page header
|
||||
}
|
||||
|
||||
// Call the particular page
|
||||
Page *currentPage=pages[pageNumber].page;
|
||||
if (currentPage == NULL){
|
||||
LOG_DEBUG(GwLog::ERROR,"page number %d not found",pageNumber);
|
||||
// Error handling for missing page
|
||||
if (systemPage) {
|
||||
displayFooter(commonData);
|
||||
PageData sysparams; // empty
|
||||
syspage->displayPage(sysparams);
|
||||
}
|
||||
else{
|
||||
if (lastPage != pageNumber){
|
||||
if (hasFRAM) fram.write(FRAM_PAGE_NO, pageNumber); // remember page for device restart
|
||||
currentPage->setupKeys();
|
||||
currentPage->displayNew(pages[pageNumber].parameters);
|
||||
lastPage=pageNumber;
|
||||
else {
|
||||
Page *currentPage = pages[pageNumber].page;
|
||||
if (currentPage == NULL){
|
||||
LOG_DEBUG(GwLog::ERROR,"page number %d not found", pageNumber);
|
||||
// Error handling for missing page
|
||||
getdisplay().setPartialWindow(0, 0, getdisplay().width(), getdisplay().height()); // Set partial update
|
||||
getdisplay().fillScreen(commonData.bgcolor); // Clear display
|
||||
getdisplay().drawXBitmap(200 - unknown_width / 2, 150 - unknown_height / 2, unknown_bits, unknown_width, unknown_height, commonData.fgcolor);
|
||||
getdisplay().setCursor(140, 250);
|
||||
getdisplay().setFont(&Atari16px);
|
||||
getdisplay().print("Here be dragons!");
|
||||
getdisplay().nextPage(); // Partial update (fast)
|
||||
}
|
||||
//call the page code
|
||||
LOG_DEBUG(GwLog::DEBUG,"calling page %d",pageNumber);
|
||||
// Show footer if enabled (together with header)
|
||||
if (pages[pageNumber].description && pages[pageNumber].description->header){
|
||||
displayFooter(commonData);
|
||||
else{
|
||||
if (lastPage != pageNumber){
|
||||
if (hasFRAM) fram.write(FRAM_PAGE_NO, pageNumber); // remember page for device restart
|
||||
currentPage->setupKeys();
|
||||
currentPage->displayNew(pages[pageNumber].parameters);
|
||||
lastPage=pageNumber;
|
||||
}
|
||||
//call the page code
|
||||
LOG_DEBUG(GwLog::DEBUG,"calling page %d",pageNumber);
|
||||
// Show footer if enabled (together with header)
|
||||
if (pages[pageNumber].description && pages[pageNumber].description->header){
|
||||
displayFooter(commonData);
|
||||
}
|
||||
currentPage->displayPage(pages[pageNumber].parameters);
|
||||
}
|
||||
currentPage->displayPage(pages[pageNumber].parameters);
|
||||
|
||||
}
|
||||
}
|
||||
} // refresh display all 1s
|
||||
}
|
||||
}
|
||||
vTaskDelete(NULL);
|
||||
|
||||
@@ -40,7 +40,7 @@ lib_deps =
|
||||
build_flags=
|
||||
#https://thingpulse.com/usb-settings-for-logging-with-the-esp32-s3-in-platformio/?srsltid=AfmBOopGskbkr4GoeVkNlFaZXe_zXkLceKF6Rn-tmoXABCeAR2vWsdHL
|
||||
# -D ARDUINO_USB_MODE=1 #0=OTG (to implement other external devices), 1=CDC (is a serial device)
|
||||
# -D ARDUINO_USB_CDC_ON_BOOT=1 #0=JTAG, 1=CDC (serial device)
|
||||
-D ARDUINO_USB_CDC_ON_BOOT=0 #Serial output via RX/TX
|
||||
# -D CORE_DEBUG_LEVEL=1 #Debug level for CPU core via CDC (seral device)
|
||||
# -D TIME=$UNIX_TIME #Set PC time for RTC (only settable via VSC)
|
||||
-D DISABLE_DIAGNOSTIC_OUTPUT #Disable diagnostic output for GxEPD2 lib
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<script type="module" src="cibuild.js"></script>
|
||||
@@ -83,4 +83,4 @@
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -867,5 +867,27 @@ class PipelineInfo{
|
||||
buildSelectors(ROOT_PATH,structure.config.children,true);
|
||||
if (! isRunning()) findPipeline();
|
||||
updateStatus();
|
||||
const translationCheck=()=>{
|
||||
const lang = document.documentElement.lang;
|
||||
if (lang != "en"){
|
||||
alert(
|
||||
"This page will not work correctly with translation enabled"
|
||||
);
|
||||
}
|
||||
}
|
||||
// Works at least for Chrome, Firefox, Safari and probably more. Not Microsoft
|
||||
// Edge though. They're special.
|
||||
// Yell at clouds if a translator doesn't change it
|
||||
const observer = new MutationObserver(() => {
|
||||
translationCheck();
|
||||
});
|
||||
observer.observe(document.documentElement, {
|
||||
attributes: true,
|
||||
attributeFilter: ['lang'],
|
||||
childList: false,
|
||||
characterData: false,
|
||||
});
|
||||
translationCheck();
|
||||
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user