mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-22 04:58:01 +00:00
Merge remote-tracking branch 'origin/master' into NextHopRouter
This commit is contained in:
commit
e593d54743
@ -1 +1 @@
|
|||||||
Subproject commit 52688fdccb8a40c23101cada3736b3b22c2b229e
|
Subproject commit af7521c3a77d56eb7a64efae5637a311ac33f76d
|
@ -101,9 +101,9 @@ std::vector<MeshModule *> moduleFrames;
|
|||||||
static char ourId[5];
|
static char ourId[5];
|
||||||
|
|
||||||
// vector where symbols (string) are displayed in bottom corner of display.
|
// vector where symbols (string) are displayed in bottom corner of display.
|
||||||
std::vector<std::string> functionSymbals;
|
std::vector<std::string> functionSymbol;
|
||||||
// string displayed in bottom right corner of display. Created from elements in functionSymbals vector
|
// string displayed in bottom right corner of display. Created from elements in functionSymbol vector
|
||||||
std::string functionSymbalString = "";
|
std::string functionSymbolString = "";
|
||||||
|
|
||||||
#if HAS_GPS
|
#if HAS_GPS
|
||||||
// GeoCoord object for the screen
|
// GeoCoord object for the screen
|
||||||
@ -243,10 +243,10 @@ static void drawWelcomeScreen(OLEDDisplay *display, OLEDDisplayUiState *state, i
|
|||||||
static void drawFunctionOverlay(OLEDDisplay *display, OLEDDisplayUiState *state)
|
static void drawFunctionOverlay(OLEDDisplay *display, OLEDDisplayUiState *state)
|
||||||
{
|
{
|
||||||
// LOG_DEBUG("Draw function overlay");
|
// LOG_DEBUG("Draw function overlay");
|
||||||
if (functionSymbals.begin() != functionSymbals.end()) {
|
if (functionSymbol.begin() != functionSymbol.end()) {
|
||||||
char buf[64];
|
char buf[64];
|
||||||
display->setFont(FONT_SMALL);
|
display->setFont(FONT_SMALL);
|
||||||
snprintf(buf, sizeof(buf), "%s", functionSymbalString.c_str());
|
snprintf(buf, sizeof(buf), "%s", functionSymbolString.c_str());
|
||||||
display->drawString(SCREEN_WIDTH - display->getStringWidth(buf), SCREEN_HEIGHT - FONT_HEIGHT_SMALL, buf);
|
display->drawString(SCREEN_WIDTH - display->getStringWidth(buf), SCREEN_HEIGHT - FONT_HEIGHT_SMALL, buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -966,6 +966,16 @@ static void drawTextMessageFrame(OLEDDisplay *display, OLEDDisplayUiState *state
|
|||||||
display->drawXbm(x + (SCREEN_WIDTH - thumbs_width) / 2,
|
display->drawXbm(x + (SCREEN_WIDTH - thumbs_width) / 2,
|
||||||
y + (SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM - thumbs_height) / 2 + 2 + 5, thumbs_width, thumbs_height,
|
y + (SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM - thumbs_height) / 2 + 2 + 5, thumbs_width, thumbs_height,
|
||||||
thumbdown);
|
thumbdown);
|
||||||
|
} else if (strcmp(reinterpret_cast<const char *>(mp.decoded.payload.bytes), "\U0001F60A") == 0 ||
|
||||||
|
strcmp(reinterpret_cast<const char *>(mp.decoded.payload.bytes), "\U0001F600") == 0 ||
|
||||||
|
strcmp(reinterpret_cast<const char *>(mp.decoded.payload.bytes), "\U0001F642") == 0 ||
|
||||||
|
strcmp(reinterpret_cast<const char *>(mp.decoded.payload.bytes), "\U0001F609") == 0 ||
|
||||||
|
strcmp(reinterpret_cast<const char *>(mp.decoded.payload.bytes), "\U0001F601") ==
|
||||||
|
0) { // matches 5 different common smileys, so that the phone user doesn't have to remember which one is
|
||||||
|
// compatible
|
||||||
|
display->drawXbm(x + (SCREEN_WIDTH - smiley_width) / 2,
|
||||||
|
y + (SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM - smiley_height) / 2 + 2 + 5, smiley_width, smiley_height,
|
||||||
|
smiley);
|
||||||
} else if (strcmp(reinterpret_cast<const char *>(mp.decoded.payload.bytes), "❓") == 0) {
|
} else if (strcmp(reinterpret_cast<const char *>(mp.decoded.payload.bytes), "❓") == 0) {
|
||||||
display->drawXbm(x + (SCREEN_WIDTH - question_width) / 2,
|
display->drawXbm(x + (SCREEN_WIDTH - question_width) / 2,
|
||||||
y + (SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM - question_height) / 2 + 2 + 5, question_width, question_height,
|
y + (SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM - question_height) / 2 + 2 + 5, question_width, question_height,
|
||||||
@ -2242,24 +2252,24 @@ void Screen::decreaseBrightness()
|
|||||||
/* TO DO: add little popup in center of screen saying what brightness level it is set to*/
|
/* TO DO: add little popup in center of screen saying what brightness level it is set to*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void Screen::setFunctionSymbal(std::string sym)
|
void Screen::setFunctionSymbol(std::string sym)
|
||||||
{
|
{
|
||||||
if (std::find(functionSymbals.begin(), functionSymbals.end(), sym) == functionSymbals.end()) {
|
if (std::find(functionSymbol.begin(), functionSymbol.end(), sym) == functionSymbol.end()) {
|
||||||
functionSymbals.push_back(sym);
|
functionSymbol.push_back(sym);
|
||||||
functionSymbalString = "";
|
functionSymbolString = "";
|
||||||
for (auto symbol : functionSymbals) {
|
for (auto symbol : functionSymbol) {
|
||||||
functionSymbalString = symbol + " " + functionSymbalString;
|
functionSymbolString = symbol + " " + functionSymbolString;
|
||||||
}
|
}
|
||||||
setFastFramerate();
|
setFastFramerate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Screen::removeFunctionSymbal(std::string sym)
|
void Screen::removeFunctionSymbol(std::string sym)
|
||||||
{
|
{
|
||||||
functionSymbals.erase(std::remove(functionSymbals.begin(), functionSymbals.end(), sym), functionSymbals.end());
|
functionSymbol.erase(std::remove(functionSymbol.begin(), functionSymbol.end(), sym), functionSymbol.end());
|
||||||
functionSymbalString = "";
|
functionSymbolString = "";
|
||||||
for (auto symbol : functionSymbals) {
|
for (auto symbol : functionSymbol) {
|
||||||
functionSymbalString = symbol + " " + functionSymbalString;
|
functionSymbolString = symbol + " " + functionSymbolString;
|
||||||
}
|
}
|
||||||
setFastFramerate();
|
setFastFramerate();
|
||||||
}
|
}
|
||||||
|
@ -24,8 +24,8 @@ class Screen
|
|||||||
void startFirmwareUpdateScreen() {}
|
void startFirmwareUpdateScreen() {}
|
||||||
void increaseBrightness() {}
|
void increaseBrightness() {}
|
||||||
void decreaseBrightness() {}
|
void decreaseBrightness() {}
|
||||||
void setFunctionSymbal(std::string) {}
|
void setFunctionSymbol(std::string) {}
|
||||||
void removeFunctionSymbal(std::string) {}
|
void removeFunctionSymbol(std::string) {}
|
||||||
void startAlert(const char *) {}
|
void startAlert(const char *) {}
|
||||||
void endAlert() {}
|
void endAlert() {}
|
||||||
};
|
};
|
||||||
@ -282,8 +282,8 @@ class Screen : public concurrency::OSThread
|
|||||||
void increaseBrightness();
|
void increaseBrightness();
|
||||||
void decreaseBrightness();
|
void decreaseBrightness();
|
||||||
|
|
||||||
void setFunctionSymbal(std::string sym);
|
void setFunctionSymbol(std::string sym);
|
||||||
void removeFunctionSymbal(std::string sym);
|
void removeFunctionSymbol(std::string sym);
|
||||||
|
|
||||||
/// Stops showing the boot screen.
|
/// Stops showing the boot screen.
|
||||||
void stopBootScreen() { enqueueCmd(ScreenCmd{.cmd = Cmd::STOP_BOOT_SCREEN}); }
|
void stopBootScreen() { enqueueCmd(ScreenCmd{.cmd = Cmd::STOP_BOOT_SCREEN}); }
|
||||||
|
@ -56,6 +56,16 @@ static unsigned char thumbdown[] PROGMEM = {
|
|||||||
0x80, 0x09, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00,
|
0x80, 0x09, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define smiley_height 30
|
||||||
|
#define smiley_width 30
|
||||||
|
static unsigned char smiley[] PROGMEM = {
|
||||||
|
0x00, 0xfe, 0x0f, 0x00, 0x80, 0x01, 0x30, 0x00, 0x40, 0x00, 0xc0, 0x00, 0x20, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x02,
|
||||||
|
0x08, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x08, 0x04, 0x00, 0x00, 0x10, 0x02, 0x0e, 0x0e, 0x10, 0x02, 0x09, 0x12, 0x10,
|
||||||
|
0x01, 0x09, 0x12, 0x20, 0x01, 0x0f, 0x1e, 0x20, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20,
|
||||||
|
0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, 0x81, 0x00, 0x20, 0x20,
|
||||||
|
0x82, 0x00, 0x20, 0x10, 0x02, 0x01, 0x10, 0x10, 0x04, 0x02, 0x08, 0x08, 0x04, 0xfc, 0x07, 0x08, 0x08, 0x00, 0x00, 0x04,
|
||||||
|
0x10, 0x00, 0x00, 0x02, 0x20, 0x00, 0x00, 0x01, 0x40, 0x00, 0xc0, 0x00, 0x80, 0x01, 0x30, 0x00, 0x00, 0xfe, 0x0f, 0x00};
|
||||||
|
|
||||||
#define question_height 25
|
#define question_height 25
|
||||||
#define question_width 25
|
#define question_width 25
|
||||||
static unsigned char question[] PROGMEM = {
|
static unsigned char question[] PROGMEM = {
|
||||||
|
@ -212,6 +212,9 @@ typedef enum _meshtastic_HardwareModel {
|
|||||||
meshtastic_HardwareModel_MS24SF1 = 82,
|
meshtastic_HardwareModel_MS24SF1 = 82,
|
||||||
/* Lilygo TLora-C6 with the new ESP32-C6 MCU */
|
/* Lilygo TLora-C6 with the new ESP32-C6 MCU */
|
||||||
meshtastic_HardwareModel_TLORA_C6 = 83,
|
meshtastic_HardwareModel_TLORA_C6 = 83,
|
||||||
|
/* WisMesh Tap
|
||||||
|
RAK-4631 w/ TFT in injection modled case */
|
||||||
|
meshtastic_HardwareModel_WISMESH_TAP = 84,
|
||||||
/* ------------------------------------------------------------------------------------------------------------------------------------------
|
/* ------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits.
|
Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits.
|
||||||
------------------------------------------------------------------------------------------------------------------------------------------ */
|
------------------------------------------------------------------------------------------------------------------------------------------ */
|
||||||
@ -751,9 +754,11 @@ typedef struct _meshtastic_MeshPacket {
|
|||||||
meshtastic_MeshPacket_public_key_t public_key;
|
meshtastic_MeshPacket_public_key_t public_key;
|
||||||
/* Indicates whether the packet was en/decrypted using PKI */
|
/* Indicates whether the packet was en/decrypted using PKI */
|
||||||
bool pki_encrypted;
|
bool pki_encrypted;
|
||||||
/* Last byte of the node number of the node that should be used as the next hop in routing. */
|
/* Last byte of the node number of the node that should be used as the next hop in routing.
|
||||||
|
Set by the firmware internally, clients are not supposed to set this. */
|
||||||
uint8_t next_hop;
|
uint8_t next_hop;
|
||||||
/* Last byte of the node number of the node that will relay/relayed this packet. */
|
/* Last byte of the node number of the node that will relay/relayed this packet.
|
||||||
|
Set by the firmware internally, clients are not supposed to set this. */
|
||||||
uint8_t relay_node;
|
uint8_t relay_node;
|
||||||
} meshtastic_MeshPacket;
|
} meshtastic_MeshPacket;
|
||||||
|
|
||||||
|
@ -234,13 +234,13 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event)
|
|||||||
screen->decreaseBrightness();
|
screen->decreaseBrightness();
|
||||||
LOG_DEBUG("Decrease Screen Brightness");
|
LOG_DEBUG("Decrease Screen Brightness");
|
||||||
break;
|
break;
|
||||||
case INPUT_BROKER_MSG_FN_SYMBOL_ON: // draw modifier (function) symbal
|
case INPUT_BROKER_MSG_FN_SYMBOL_ON: // draw modifier (function) symbol
|
||||||
if (screen)
|
if (screen)
|
||||||
screen->setFunctionSymbal("Fn");
|
screen->setFunctionSymbol("Fn");
|
||||||
break;
|
break;
|
||||||
case INPUT_BROKER_MSG_FN_SYMBOL_OFF: // remove modifier (function) symbal
|
case INPUT_BROKER_MSG_FN_SYMBOL_OFF: // remove modifier (function) symbol
|
||||||
if (screen)
|
if (screen)
|
||||||
screen->removeFunctionSymbal("Fn");
|
screen->removeFunctionSymbol("Fn");
|
||||||
break;
|
break;
|
||||||
// mute (switch off/toggle) external notifications on fn+m
|
// mute (switch off/toggle) external notifications on fn+m
|
||||||
case INPUT_BROKER_MSG_MUTE_TOGGLE:
|
case INPUT_BROKER_MSG_MUTE_TOGGLE:
|
||||||
@ -249,13 +249,13 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event)
|
|||||||
externalNotificationModule->setMute(false);
|
externalNotificationModule->setMute(false);
|
||||||
showTemporaryMessage("Notifications \nEnabled");
|
showTemporaryMessage("Notifications \nEnabled");
|
||||||
if (screen)
|
if (screen)
|
||||||
screen->removeFunctionSymbal("M"); // remove the mute symbol from the bottom right corner
|
screen->removeFunctionSymbol("M"); // remove the mute symbol from the bottom right corner
|
||||||
} else {
|
} else {
|
||||||
externalNotificationModule->stopNow(); // this will turn off all GPIO and sounds and idle the loop
|
externalNotificationModule->stopNow(); // this will turn off all GPIO and sounds and idle the loop
|
||||||
externalNotificationModule->setMute(true);
|
externalNotificationModule->setMute(true);
|
||||||
showTemporaryMessage("Notifications \nDisabled");
|
showTemporaryMessage("Notifications \nDisabled");
|
||||||
if (screen)
|
if (screen)
|
||||||
screen->setFunctionSymbal("M"); // add the mute symbol to the bottom right corner
|
screen->setFunctionSymbol("M"); // add the mute symbol to the bottom right corner
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -308,7 +308,7 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (screen && (event->kbchar != INPUT_BROKER_MSG_FN_SYMBOL_ON)) {
|
if (screen && (event->kbchar != INPUT_BROKER_MSG_FN_SYMBOL_ON)) {
|
||||||
screen->removeFunctionSymbal("Fn"); // remove modifier (function) symbal
|
screen->removeFunctionSymbol("Fn"); // remove modifier (function) symbol
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -672,7 +672,7 @@ int32_t CannedMessageModule::runOnce()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (screen)
|
if (screen)
|
||||||
screen->removeFunctionSymbal("Fn");
|
screen->removeFunctionSymbol("Fn");
|
||||||
}
|
}
|
||||||
|
|
||||||
this->lastTouchMillis = millis();
|
this->lastTouchMillis = millis();
|
||||||
|
@ -9,7 +9,6 @@ build_flags = ${nrf52840_base.build_flags} -Ivariants/rak_wismeshtap -D RAK_4631
|
|||||||
-DEINK_WIDTH=250
|
-DEINK_WIDTH=250
|
||||||
-DEINK_HEIGHT=122
|
-DEINK_HEIGHT=122
|
||||||
-DMESHTASTIC_EXCLUDE_WIFI=1
|
-DMESHTASTIC_EXCLUDE_WIFI=1
|
||||||
-DMESHTASTIC_EXCLUDE_WAYPOINT=1
|
|
||||||
-DMESHTASTIC_EXCLUDE_DETECTIONSENSOR=1
|
-DMESHTASTIC_EXCLUDE_DETECTIONSENSOR=1
|
||||||
-DMESHTASTIC_EXCLUDE_STOREFORWARD=1
|
-DMESHTASTIC_EXCLUDE_STOREFORWARD=1
|
||||||
-DMESHTASTIC_EXCLUDE_POWER_TELEMETRY=1
|
-DMESHTASTIC_EXCLUDE_POWER_TELEMETRY=1
|
||||||
|
Loading…
Reference in New Issue
Block a user