mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-08 14:12:05 +00:00
Merge branch 'master' into shared-secret-cache
This commit is contained in:
commit
917b6d0cd7
@ -10,7 +10,7 @@
|
||||
"hwids": [["0x2886", "0x0059"]],
|
||||
"usb_product": "XIAO-BOOT",
|
||||
"mcu": "nrf52840",
|
||||
"variant": "Seeed_Solar_Node",
|
||||
"variant": "seeed_solar_node",
|
||||
"bsp": {
|
||||
"name": "adafruit"
|
||||
},
|
||||
@ -31,7 +31,7 @@
|
||||
"openocd_target": "nrf52840-mdk-rs"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "Seeed_Solar_Node",
|
||||
"name": "seeed_solar_node",
|
||||
"upload": {
|
||||
"maximum_ram_size": 248832,
|
||||
"maximum_size": 815104,
|
@ -300,14 +300,23 @@ int32_t ButtonThread::runOnce()
|
||||
#ifdef BUTTON_PIN_TOUCH
|
||||
case BUTTON_EVENT_TOUCH_LONG_PRESSED: {
|
||||
LOG_BUTTON("Touch press!");
|
||||
if (screen) {
|
||||
// Ignore if: no screen
|
||||
if (!screen)
|
||||
break;
|
||||
|
||||
#ifdef TTGO_T_ECHO
|
||||
// Ignore if: TX in progress
|
||||
// Uncommon T-Echo hardware bug, LoRa TX triggers touch button
|
||||
if (!RadioLibInterface::instance || RadioLibInterface::instance->isSending())
|
||||
break;
|
||||
#endif
|
||||
|
||||
// Wake if asleep
|
||||
if (powerFSM.getState() == &stateDARK)
|
||||
powerFSM.trigger(EVENT_PRESS);
|
||||
|
||||
// Update display (legacy behaviour)
|
||||
screen->forceDisplay();
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif // BUTTON_PIN_TOUCH
|
||||
|
@ -1612,6 +1612,9 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver)
|
||||
#ifdef T_WATCH_S3
|
||||
PMU->enablePowerOutput(XPOWERS_ALDO2);
|
||||
#endif
|
||||
#ifdef HELTEC_TRACKER_V1_X
|
||||
uint8_t tft_vext_enabled = digitalRead(VEXT_ENABLE);
|
||||
#endif
|
||||
#if !ARCH_PORTDUINO
|
||||
dispdev->displayOn();
|
||||
#endif
|
||||
@ -1622,6 +1625,12 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver)
|
||||
#endif
|
||||
|
||||
dispdev->displayOn();
|
||||
#ifdef HELTEC_TRACKER_V1_X
|
||||
// If the TFT VEXT power is not enabled, initialize the UI.
|
||||
if (!tft_vext_enabled) {
|
||||
ui->init();
|
||||
}
|
||||
#endif
|
||||
#ifdef USE_ST7789
|
||||
pinMode(VTFT_CTRL, OUTPUT);
|
||||
digitalWrite(VTFT_CTRL, LOW);
|
||||
|
@ -1455,6 +1455,26 @@ void NodeDB::updateTelemetry(uint32_t nodeId, const meshtastic_Telemetry &t, RxS
|
||||
notifyObservers(true); // Force an update whether or not our node counts have changed
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the node database with a new contact
|
||||
*/
|
||||
void NodeDB::addFromContact(meshtastic_SharedContact contact)
|
||||
{
|
||||
meshtastic_NodeInfoLite *info = getOrCreateMeshNode(contact.node_num);
|
||||
if (!info) {
|
||||
return;
|
||||
}
|
||||
info->num = contact.node_num;
|
||||
info->last_heard = getValidTime(RTCQualityNTP);
|
||||
info->has_user = true;
|
||||
info->user = TypeConversions::ConvertToUserLite(contact.user);
|
||||
info->is_favorite = true;
|
||||
updateGUIforNode = info;
|
||||
powerFSM.trigger(EVENT_NODEDB_UPDATED);
|
||||
notifyObservers(true); // Force an update whether or not our node counts have changed
|
||||
saveNodeDatabaseToDisk();
|
||||
}
|
||||
|
||||
/** Update user info and channel for this node based on received user data
|
||||
*/
|
||||
bool NodeDB::updateUser(uint32_t nodeId, meshtastic_User &p, uint8_t channelIndex)
|
||||
|
@ -110,6 +110,8 @@ class NodeDB
|
||||
/// we updateGUI and updateGUIforNode if we think our this change is big enough for a redraw
|
||||
void updateFrom(const meshtastic_MeshPacket &p);
|
||||
|
||||
void addFromContact(const meshtastic_SharedContact);
|
||||
|
||||
/** Update position info for this node based on received position data
|
||||
*/
|
||||
void updatePosition(uint32_t nodeId, const meshtastic_Position &p, RxSource src = RX_SRC_RADIO);
|
||||
|
@ -286,6 +286,11 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
|
||||
nodeDB->removeNodeByNum(r->remove_by_nodenum);
|
||||
break;
|
||||
}
|
||||
case meshtastic_AdminMessage_add_contact_tag: {
|
||||
LOG_INFO("Client received add_contact command");
|
||||
nodeDB->addFromContact(r->add_contact);
|
||||
break;
|
||||
}
|
||||
case meshtastic_AdminMessage_set_favorite_node_tag: {
|
||||
LOG_INFO("Client received set_favorite_node command");
|
||||
meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(r->set_favorite_node);
|
||||
|
@ -15,7 +15,7 @@ int32_t SHTC3Sensor::runOnce()
|
||||
if (!hasSensor()) {
|
||||
return DEFAULT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS;
|
||||
}
|
||||
status = shtc3.begin();
|
||||
status = shtc3.begin(nodeTelemetrySensorsMap[sensorType].second);
|
||||
return initI2CSensor();
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,6 @@
|
||||
#define ADC_CHANNEL ADC1_GPIO7_CHANNEL
|
||||
#define ADC_MULTIPLIER 4.9 * 1.03
|
||||
#define ADC_ATTENUATION ADC_ATTEN_DB_2_5
|
||||
#define HAS_32768HZ
|
||||
|
||||
// LoRa
|
||||
#define USE_SX1262
|
||||
|
@ -30,7 +30,6 @@
|
||||
#define ADC_CHANNEL ADC1_GPIO7_CHANNEL
|
||||
#define ADC_MULTIPLIER 4.9 * 1.03
|
||||
#define ADC_ATTENUATION ADC_ATTEN_DB_2_5
|
||||
#define HAS_32768HZ
|
||||
|
||||
// LoRa
|
||||
#define USE_SX1262
|
||||
|
@ -47,7 +47,6 @@
|
||||
#define ADC_CHANNEL ADC1_GPIO6_CHANNEL
|
||||
#define ADC_MULTIPLIER 4.9 * 1.03 // Voltage divider is roughly 1:1
|
||||
#define ADC_ATTENUATION ADC_ATTEN_DB_2_5 // Voltage divider output is quite high
|
||||
#define HAS_32768HZ
|
||||
|
||||
// LoRa
|
||||
#define USE_SX1262
|
||||
|
@ -28,7 +28,6 @@
|
||||
#define ADC_MULTIPLIER 2 // Voltage divider is roughly 1:1
|
||||
#define BAT_MEASURE_ADC_UNIT 2 // Use ADC2
|
||||
#define ADC_ATTENUATION ADC_ATTEN_DB_12 // Voltage divider output is quite high
|
||||
#define HAS_32768HZ
|
||||
#define ADC_CTRL_ENABLED LOW
|
||||
|
||||
#define NO_EXT_GPIO 1
|
||||
|
@ -29,7 +29,6 @@
|
||||
#define ADC_MULTIPLIER 2 // Voltage divider is roughly 1:1
|
||||
#define BAT_MEASURE_ADC_UNIT 2 // Use ADC2
|
||||
#define ADC_ATTENUATION ADC_ATTEN_DB_12 // Voltage divider output is quite high
|
||||
#define HAS_32768HZ
|
||||
#define ADC_CTRL_ENABLED LOW
|
||||
|
||||
#define NO_EXT_GPIO 1
|
||||
|
@ -1,13 +1,13 @@
|
||||
[env:Seeed_Solar_Node]
|
||||
board = Seeed_Solar_Node
|
||||
[env:seeed_solar_node]
|
||||
board = seeed_solar_node
|
||||
extends = nrf52840_base
|
||||
;board_level = extra
|
||||
build_flags = ${nrf52840_base.build_flags}
|
||||
-I $PROJECT_DIR/variants/Seeed_Solar_Node
|
||||
-I $PROJECT_DIR/variants/seeed_solar_node
|
||||
-D SEEED_SOLAR_NODE
|
||||
-Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52
|
||||
board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/Seeed_Solar_Node>
|
||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/seeed_solar_node>
|
||||
lib_deps =
|
||||
${nrf52840_base.lib_deps}
|
||||
debug_tool = jlink
|
Loading…
Reference in New Issue
Block a user