mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-24 01:16:55 +00:00
properly show plaintext msgs on oled
This commit is contained in:
parent
5c0b20e43c
commit
c0fdf227b7
@ -250,6 +250,7 @@ void NodeDB::updateFrom(const MeshPacket &mp)
|
||||
case SubPacket_data_tag: {
|
||||
// Keep a copy of the most recent text message.
|
||||
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.has_rx_text_message = true;
|
||||
updateTextMessage = true;
|
||||
@ -271,8 +272,9 @@ void NodeDB::updateFrom(const MeshPacket &mp)
|
||||
{
|
||||
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
|
||||
saveToDisk();
|
||||
// saveToDisk();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -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
|
||||
#if !defined(T_BEAM_V10) && !defined(HELTEC_LORA32)
|
||||
#define T_BEAM_V10 // AKA Rev1 (second board released)
|
||||
//#define HELTEC_LORA32
|
||||
//#define T_BEAM_V10 // AKA Rev1 (second board released)
|
||||
#define HELTEC_LORA32
|
||||
#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)
|
||||
|
@ -422,11 +422,13 @@ uint32_t ledBlinker()
|
||||
digitalWrite(LED_PIN, ledOn);
|
||||
#endif
|
||||
|
||||
#ifdef T_BEAM_V10
|
||||
if (axp192_found)
|
||||
{
|
||||
// blink the axp led
|
||||
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
|
||||
return isCharging ? 1000 : (ledOn ? 2 : 1000);
|
||||
|
@ -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
|
||||
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
|
||||
wakeScreen = false;
|
||||
@ -570,10 +570,11 @@ uint32_t screen_loop()
|
||||
else // standard screen loop handling ehre
|
||||
{
|
||||
// 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();
|
||||
nodeDB.updateGUI = false;
|
||||
nodeDB.updateTextMessage = false;
|
||||
}
|
||||
|
||||
if (millis() - lastPressMs > SCREEN_SLEEP_MS)
|
||||
|
Loading…
Reference in New Issue
Block a user