mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-26 18:09:04 +00:00
Merge branch 'master' of https://github.com/Nasimovy/meshtastic-firmware
This commit is contained in:
commit
3743269721
@ -18,8 +18,7 @@ namespace NicheGraphics::InkHUD
|
|||||||
|
|
||||||
enum MenuAction {
|
enum MenuAction {
|
||||||
NO_ACTION,
|
NO_ACTION,
|
||||||
SEND_NODEINFO,
|
SEND_PING,
|
||||||
SEND_POSITION,
|
|
||||||
SHUTDOWN,
|
SHUTDOWN,
|
||||||
NEXT_TILE,
|
NEXT_TILE,
|
||||||
TOGGLE_BACKLIGHT,
|
TOGGLE_BACKLIGHT,
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
#include "RTC.h"
|
#include "RTC.h"
|
||||||
|
|
||||||
|
#include "MeshService.h"
|
||||||
#include "airtime.h"
|
#include "airtime.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "power.h"
|
#include "power.h"
|
||||||
@ -144,6 +145,14 @@ void InkHUD::MenuApplet::execute(MenuItem item)
|
|||||||
inkhud->nextTile();
|
inkhud->nextTile();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case SEND_PING:
|
||||||
|
service->refreshLocalMeshNode();
|
||||||
|
service->trySendPosition(NODENUM_BROADCAST, true);
|
||||||
|
|
||||||
|
// Force the next refresh to use FULL, to protect the display, as some users will probably spam this button
|
||||||
|
inkhud->forceUpdate(Drivers::EInk::UpdateTypes::FULL);
|
||||||
|
break;
|
||||||
|
|
||||||
case ROTATE:
|
case ROTATE:
|
||||||
inkhud->rotate();
|
inkhud->rotate();
|
||||||
break;
|
break;
|
||||||
@ -242,7 +251,7 @@ void InkHUD::MenuApplet::showPage(MenuPage page)
|
|||||||
if (settings->optionalMenuItems.nextTile && settings->userTiles.count > 1)
|
if (settings->optionalMenuItems.nextTile && settings->userTiles.count > 1)
|
||||||
items.push_back(MenuItem("Next Tile", MenuAction::NEXT_TILE, MenuPage::ROOT)); // Only if multiple applets shown
|
items.push_back(MenuItem("Next Tile", MenuAction::NEXT_TILE, MenuPage::ROOT)); // Only if multiple applets shown
|
||||||
|
|
||||||
// items.push_back(MenuItem("Send", MenuPage::SEND)); // TODO
|
items.push_back(MenuItem("Send", MenuPage::SEND));
|
||||||
items.push_back(MenuItem("Options", MenuPage::OPTIONS));
|
items.push_back(MenuItem("Options", MenuPage::OPTIONS));
|
||||||
// items.push_back(MenuItem("Display Off", MenuPage::EXIT)); // TODO
|
// items.push_back(MenuItem("Display Off", MenuPage::EXIT)); // TODO
|
||||||
items.push_back(MenuItem("Save & Shut Down", MenuAction::SHUTDOWN));
|
items.push_back(MenuItem("Save & Shut Down", MenuAction::SHUTDOWN));
|
||||||
@ -250,9 +259,8 @@ void InkHUD::MenuApplet::showPage(MenuPage page)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SEND:
|
case SEND:
|
||||||
items.push_back(MenuItem("Send Message", MenuPage::EXIT));
|
items.push_back(MenuItem("Ping", MenuAction::SEND_PING, MenuPage::EXIT));
|
||||||
items.push_back(MenuItem("Send NodeInfo", MenuAction::SEND_NODEINFO));
|
// Todo: canned messages
|
||||||
items.push_back(MenuItem("Send Position", MenuAction::SEND_POSITION));
|
|
||||||
items.push_back(MenuItem("Exit", MenuPage::EXIT));
|
items.push_back(MenuItem("Exit", MenuPage::EXIT));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -389,11 +397,14 @@ void InkHUD::MenuApplet::onRender()
|
|||||||
// Center-line for the text
|
// Center-line for the text
|
||||||
int16_t center = itemT + (itemH / 2);
|
int16_t center = itemT + (itemH / 2);
|
||||||
|
|
||||||
|
// Box, if currently selected
|
||||||
if (cursorShown && i == cursor)
|
if (cursorShown && i == cursor)
|
||||||
drawRect(itemL, itemT, itemW, itemH, BLACK);
|
drawRect(itemL, itemT, itemW, itemH, BLACK);
|
||||||
|
|
||||||
|
// Item's text
|
||||||
printAt(itemL + X(padding), center, item.label, LEFT, MIDDLE);
|
printAt(itemL + X(padding), center, item.label, LEFT, MIDDLE);
|
||||||
|
|
||||||
// Testing only: circle instead of check box
|
// Checkbox, if relevant
|
||||||
if (item.checkState) {
|
if (item.checkState) {
|
||||||
const uint16_t cbWH = fontSmall.lineHeight(); // Checkbox: width / height
|
const uint16_t cbWH = fontSmall.lineHeight(); // Checkbox: width / height
|
||||||
const int16_t cbL = itemR - X(padding) - cbWH; // Checkbox: left
|
const int16_t cbL = itemR - X(padding) - cbWH; // Checkbox: left
|
||||||
|
@ -163,7 +163,7 @@ static int32_t reconnectWiFi()
|
|||||||
delay(5000);
|
delay(5000);
|
||||||
|
|
||||||
if (!WiFi.isConnected()) {
|
if (!WiFi.isConnected()) {
|
||||||
#ifdef ARCH_ESP32
|
#ifdef CONFIG_IDF_TARGET_ESP32C3
|
||||||
WiFi.mode(WIFI_MODE_NULL);
|
WiFi.mode(WIFI_MODE_NULL);
|
||||||
WiFi.useStaticBuffers(true);
|
WiFi.useStaticBuffers(true);
|
||||||
WiFi.mode(WIFI_STA);
|
WiFi.mode(WIFI_STA);
|
||||||
|
Loading…
Reference in New Issue
Block a user