centralize display writes (part 6)
This commit is contained in:
parent
68cded9c71
commit
a3f23aef25
@ -115,7 +115,7 @@ Note: all settings are stored in NVRAM and will be reloaded when device starts.
|
||||
1 = cumulative counter, mac counter is never reset
|
||||
2 = cyclic confirmed, like 0 but data is resent until confirmation by network received
|
||||
|
||||
0x03 set screen saver mode
|
||||
0x03 (NOT YET IMPLEMENTED) set screen saver mode
|
||||
|
||||
0 = screen saver off [default]
|
||||
1 = screen saver on
|
||||
|
@ -10,9 +10,9 @@
|
||||
|
||||
; ---> SELECT TARGET PLATFORM HERE! <---
|
||||
[platformio]
|
||||
env_default = heltec_wifi_lora_32
|
||||
;env_default = heltec_wifi_lora_32
|
||||
;env_default = ttgov1
|
||||
;env_default = ttgov2
|
||||
env_default = ttgov2
|
||||
;env_default = lopy
|
||||
;env_default = lopy4
|
||||
;env_default = lolin32lite_lora
|
||||
|
13
src/main.cpp
13
src/main.cpp
@ -306,13 +306,16 @@ void sniffer_loop(void * pvParameters) {
|
||||
yield();
|
||||
}
|
||||
sprintf(display_lora, " "); // clear LoRa wait message fromd display
|
||||
|
||||
|
||||
/*
|
||||
// TBD: need to check if long 2000ms pause causes stack problems while scanning continues
|
||||
if (cfg.screenon && cfg.screensaver) {
|
||||
vTaskDelay(2000/portTICK_PERIOD_MS); // pause for displaying results
|
||||
yield();
|
||||
u8x8.setPowerSave(1 && cfg.screensaver); // set display off if screensaver is enabled
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
} // end of send data cycle
|
||||
|
||||
} // end of infinite wifi channel rotation loop
|
||||
@ -534,8 +537,10 @@ void loop() {
|
||||
u8x8.setCursor(0,4);
|
||||
u8x8.printf("WIFI: %-4d", (int) wifis.size());
|
||||
#ifdef BLECOUNTER
|
||||
if (cfg.blescan) {
|
||||
u8x8.setCursor(0,3);
|
||||
u8x8.printf("BLTH: %-4d", (int) bles.size());
|
||||
}
|
||||
#endif
|
||||
|
||||
// update wifi channel display (line 4)
|
||||
@ -544,7 +549,7 @@ void loop() {
|
||||
|
||||
// update RSSI limiter status display (line 5)
|
||||
u8x8.setCursor(0,5);
|
||||
u8x8.printf(!cfg.rssilimit ? "RLIM: off" : "RLIM: %-3d", cfg.rssilimit);
|
||||
u8x8.printf(!cfg.rssilimit ? "RLIM: off" : "RLIM: %-4d", cfg.rssilimit);
|
||||
|
||||
// update LoRa status display (line 6)
|
||||
u8x8.setCursor(0,6);
|
||||
@ -556,7 +561,7 @@ void loop() {
|
||||
|
||||
#endif
|
||||
|
||||
vTaskDelay(DISPLAYREFRESH/portTICK_PERIOD_MS);
|
||||
vTaskDelay(1000/DISPLAYFPS/portTICK_PERIOD_MS);
|
||||
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@
|
||||
#define RGBLUMINOSITY 30 // 30%
|
||||
|
||||
// OLED Display refresh cycle (in Milliseconds)
|
||||
#define DISPLAYREFRESH 200 // 200ms
|
||||
#define DISPLAYFPS 5 // [fps] -> 5 Frames per second ps = 200ms refreseh cycle
|
||||
|
||||
// LMIC settings
|
||||
// define hardware independent LMIC settings here, settings of standard library in /lmic/config.h will be ignored
|
||||
|
@ -58,9 +58,7 @@ void set_reset(int val) {
|
||||
switch (val) {
|
||||
case 0: // restart device
|
||||
ESP_LOGI(TAG, "Remote command: restart device");
|
||||
u8x8.clearLine(5);
|
||||
u8x8.setCursor(0, 5);
|
||||
u8x8.printf("Reset pending ");
|
||||
sprintf(display_lora, "Reset pending");
|
||||
vTaskDelay(10000/portTICK_PERIOD_MS); // wait for LMIC to confirm LoRa downlink to server
|
||||
esp_restart();
|
||||
break;
|
||||
@ -72,16 +70,11 @@ void set_reset(int val) {
|
||||
bles.clear(); // clear BLE macs container
|
||||
#endif
|
||||
salt_reset(); // get new 16bit salt
|
||||
u8x8.clearLine(0); u8x8.clearLine(1); // clear Display counter
|
||||
u8x8.clearLine(5);
|
||||
u8x8.setCursor(0, 5);
|
||||
u8x8.printf("Reset counter ");
|
||||
sprintf(display_lora, "Reset counter");
|
||||
break;
|
||||
case 2: // reset device to factory settings
|
||||
ESP_LOGI(TAG, "Remote command: reset device to factory settings");
|
||||
u8x8.clearLine(5);
|
||||
u8x8.setCursor(0, 5);
|
||||
u8x8.printf("Factory reset ");
|
||||
sprintf(display_lora, "Factory reset");
|
||||
eraseConfig();
|
||||
break;
|
||||
}
|
||||
@ -90,9 +83,6 @@ void set_reset(int val) {
|
||||
void set_rssi(int val) {
|
||||
cfg.rssilimit = val * -1;
|
||||
ESP_LOGI(TAG, "Remote command: set RSSI limit to %i", cfg.rssilimit);
|
||||
u8x8.clearLine(5);
|
||||
u8x8.setCursor(0, 5);
|
||||
u8x8.printf(!cfg.rssilimit ? "RLIM: off" : "RLIM: -%4i", cfg.rssilimit);
|
||||
};
|
||||
|
||||
void set_wifiscancycle(int val) {
|
||||
@ -133,7 +123,6 @@ void set_screensaver(int val) {
|
||||
case 1: cfg.screensaver = val; break;
|
||||
default: cfg.screensaver = 0; break;
|
||||
}
|
||||
u8x8.setPowerSave(cfg.screensaver); // set display 0=on / 1=off
|
||||
};
|
||||
|
||||
void set_display(int val) {
|
||||
@ -142,7 +131,6 @@ void set_display(int val) {
|
||||
case 1: cfg.screenon = val; break;
|
||||
default: cfg.screenon = 0; break;
|
||||
}
|
||||
u8x8.setPowerSave(!cfg.screenon); // set display 0=on / 1=off
|
||||
};
|
||||
|
||||
void set_lorasf(int val) {
|
||||
@ -166,7 +154,6 @@ void set_blescan(int val) {
|
||||
default:
|
||||
cfg.blescan = 0;
|
||||
btStop();
|
||||
u8x8.clearLine(3); // clear BLE results from display
|
||||
break;
|
||||
}
|
||||
};
|
||||
@ -244,12 +231,12 @@ void get_cputemp (int val) {
|
||||
cmd_t table[] = {
|
||||
{0x01, set_rssi, true},
|
||||
{0x02, set_countmode, true},
|
||||
{0x03, set_screensaver, true},
|
||||
{0x03, set_noop, false},
|
||||
{0x04, set_display, true},
|
||||
{0x05, set_lorasf, true},
|
||||
{0x06, set_lorapower, true},
|
||||
{0x07, set_loraadr, true},
|
||||
{0x08, set_noop, false},
|
||||
{0x08, set_screensaver, true},
|
||||
{0x09, set_reset, false},
|
||||
{0x0a, set_wifiscancycle, true},
|
||||
{0x0b, set_wifichancycle, true},
|
||||
|
Loading…
Reference in New Issue
Block a user