properly show plaintext msgs on oled

This commit is contained in:
geeksville 2020-02-17 16:27:29 -08:00
parent 5c0b20e43c
commit c0fdf227b7
5 changed files with 17 additions and 12 deletions

View File

@ -1,7 +1,7 @@
{ {
// See http://go.microsoft.com/fwlink/?LinkId=827846 // See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format // for the documentation about the extensions.json format
"recommendations": [ "recommendations": [
"platformio.platformio-ide" "platformio.platformio-ide"
] ]
} }

View File

@ -250,6 +250,7 @@ void NodeDB::updateFrom(const MeshPacket &mp)
case SubPacket_data_tag: { case SubPacket_data_tag: {
// Keep a copy of the most recent text message. // Keep a copy of the most recent text message.
if(p.variant.data.typ == Data_Type_CLEAR_TEXT) { if(p.variant.data.typ == Data_Type_CLEAR_TEXT) {
DEBUG_MSG("Received text msg from=0%0x, msg=%.*s\n", mp.from, p.variant.data.payload.size, p.variant.data.payload.bytes);
devicestate.rx_text_message = mp; devicestate.rx_text_message = mp;
devicestate.has_rx_text_message = true; devicestate.has_rx_text_message = true;
updateTextMessage = true; updateTextMessage = true;
@ -271,8 +272,9 @@ void NodeDB::updateFrom(const MeshPacket &mp)
{ {
updateGUIforNode = info; updateGUIforNode = info;
// Not really needed - we will save anyways when we go to sleep
// We just changed something important about the user, store our DB // We just changed something important about the user, store our DB
saveToDisk(); // saveToDisk();
} }
break; break;
} }

View File

@ -41,8 +41,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// Select which board is being used. If the outside build environment has sent a choice, just use that // Select which board is being used. If the outside build environment has sent a choice, just use that
#if !defined(T_BEAM_V10) && !defined(HELTEC_LORA32) #if !defined(T_BEAM_V10) && !defined(HELTEC_LORA32)
#define T_BEAM_V10 // AKA Rev1 (second board released) //#define T_BEAM_V10 // AKA Rev1 (second board released)
//#define HELTEC_LORA32 #define HELTEC_LORA32
#endif #endif
// If we are using the JTAG port for debugging, some pins must be left free for that (and things like GPS have to be disabled) // If we are using the JTAG port for debugging, some pins must be left free for that (and things like GPS have to be disabled)

View File

@ -422,11 +422,13 @@ uint32_t ledBlinker()
digitalWrite(LED_PIN, ledOn); digitalWrite(LED_PIN, ledOn);
#endif #endif
#ifdef T_BEAM_V10
if (axp192_found) if (axp192_found)
{ {
// blink the axp led // blink the axp led
axp.setChgLEDMode(ledOn ? AXP20X_LED_LOW_LEVEL : AXP20X_LED_OFF); axp.setChgLEDMode(ledOn ? AXP20X_LED_LOW_LEVEL : AXP20X_LED_OFF);
} }
#endif
// have a very sparse duty cycle of LED being on, unless charging, then blink 0.5Hz square wave rate to indicate that // have a very sparse duty cycle of LED being on, unless charging, then blink 0.5Hz square wave rate to indicate that
return isCharging ? 1000 : (ledOn ? 2 : 1000); return isCharging ? 1000 : (ledOn ? 2 : 1000);

View File

@ -542,7 +542,7 @@ uint32_t screen_loop()
if (!disp) // If we don't have a screen, don't ever spend any CPU for us if (!disp) // If we don't have a screen, don't ever spend any CPU for us
return UINT32_MAX; return UINT32_MAX;
if (wakeScreen) if (wakeScreen || nodeDB.updateTextMessage) // If a new text message arrived, turn the screen on immedately
{ {
screen_on(); // make sure the screen is not asleep screen_on(); // make sure the screen is not asleep
wakeScreen = false; wakeScreen = false;
@ -570,10 +570,11 @@ uint32_t screen_loop()
else // standard screen loop handling ehre else // standard screen loop handling ehre
{ {
// If the # nodes changes, we need to regen our list of screens // If the # nodes changes, we need to regen our list of screens
if (nodeDB.updateGUI) if (nodeDB.updateGUI || nodeDB.updateTextMessage)
{ {
nodeDB.updateGUI = false;
screen_set_frames(); screen_set_frames();
nodeDB.updateGUI = false;
nodeDB.updateTextMessage = false;
} }
if (millis() - lastPressMs > SCREEN_SLEEP_MS) if (millis() - lastPressMs > SCREEN_SLEEP_MS)