missing update in last commit

This commit is contained in:
Hansi, dl9rdz 2019-06-10 08:47:30 +02:00
parent 6abd6a7a1a
commit 0053c95498
2 changed files with 19 additions and 4 deletions

View File

@ -631,6 +631,10 @@ const char *handleEditPost(AsyncWebServerRequest *request) {
} }
file.print(content); file.print(content);
file.close(); file.close();
if (strcmp(filename.c_str(), "screens.txt")==0) {
// screens update => reload
disp.initFromFile();
}
return ""; return "";
} }
@ -973,18 +977,21 @@ void checkTouchStatus() {
checkTouchButton(button2); checkTouchButton(button2);
} }
unsigned long bdd1, bdd2;
void IRAM_ATTR buttonISR() { void IRAM_ATTR buttonISR() {
unsigned long now = my_millis();
if (digitalRead(button1.pin) == 0) { // Button down if (digitalRead(button1.pin) == 0) { // Button down
unsigned long now = my_millis();
if (now - button1.keydownTime < 500) { if (now - button1.keydownTime < 500) {
// Double press // Double press
button1.doublepress = 1; button1.doublepress = 1;
bdd1 = now; bdd2 = button1.keydownTime;
} else { } else {
button1.doublepress = 0; button1.doublepress = 0;
} }
button1.numberKeyPresses += 1;
button1.keydownTime = now; button1.keydownTime = now;
} else { //Button up } else { //Button up
unsigned long now = my_millis();
if (button1.doublepress == -1) return; // key was never pressed before, ignore button up if (button1.doublepress == -1) return; // key was never pressed before, ignore button up
unsigned int elapsed = now - button1.keydownTime; unsigned int elapsed = now - button1.keydownTime;
if (elapsed > 1500) { if (elapsed > 1500) {
@ -1007,7 +1014,9 @@ int getKeyPress() {
KeyPress p = button1.pressed; KeyPress p = button1.pressed;
button1.pressed = KP_NONE; button1.pressed = KP_NONE;
int x = digitalRead(button1.pin); int x = digitalRead(button1.pin);
Serial.printf("button1 press (now:%d): %d at %ld (%d)\n", x, p, button1.keydownTime, button1.numberKeyPresses); Serial.printf("Debug: bdd1=%ld, bdd2=%ld\b", bdd1, bdd2);
Serial.printf("button1 press (dbl:%d) (now:%d): %d at %ld (%d)\n", button1.doublepress, x, p, button1.keydownTime, button1.numberKeyPresses);
return p; return p;
} }
@ -1032,6 +1041,7 @@ int getKeyPressEvent() {
} }
extern int initlevels[40]; extern int initlevels[40];
extern DispInfo *layouts;
void setup() void setup()
{ {
char buf[12]; char buf[12];
@ -1090,6 +1100,11 @@ void setup()
sonde.clearDisplay(); sonde.clearDisplay();
setupWifiList(); setupWifiList();
Serial.printf("before disp.initFromFile... layouts is %p", layouts);
disp.initFromFile();
Serial.printf("disp.initFromFile... layouts is %p", layouts);
// == show initial values from config.txt ========================= // // == show initial values from config.txt ========================= //
if (sonde.config.debug == 1) { if (sonde.config.debug == 1) {

View File

@ -33,7 +33,7 @@ static unsigned char kmh_tiles[] U8X8_PROGMEM = {
0x1F, 0x04, 0x0A, 0x11, 0x00, 0x1F, 0x02, 0x04, 0x42, 0x3F, 0x10, 0x08, 0xFC, 0x22, 0x20, 0xF8 0x1F, 0x04, 0x0A, 0x11, 0x00, 0x1F, 0x02, 0x04, 0x42, 0x3F, 0x10, 0x08, 0xFC, 0x22, 0x20, 0xF8
}; };
static unsigned char ms_tiles[] U8X8_PROGMEM = { static unsigned char ms_tiles[] U8X8_PROGMEM = {
0x1F, 0x02, 0x04, 0x02, 0x1F, 0x40, 0x20, 0x10, 0x08, 0x04, 0x12, 0xA4, 0xA4, 0xA4, 0x40, 0x00 0x1F, 0x02, 0x04, 0x02, 0x1F, 0x40, 0x20, 0x10, 0x08, 0x04, 0x12, 0xA8, 0xA8, 0xA4, 0x40, 0x00
}; };
static unsigned char stattiles[5][4] = { static unsigned char stattiles[5][4] = {
0x00, 0x1F, 0x00, 0x00 , // | == ok 0x00, 0x1F, 0x00, 0x00 , // | == ok