Cherry picks (#5166)

* fix compiler error std::find()

* fix wifi/bt connection status

* try-fix crash

* added 1200baud reset

---------

Co-authored-by: mverch67 <manuel.verch@gmx.de>
This commit is contained in:
Jonathan Bennett 2024-10-27 19:21:57 -05:00 committed by GitHub
parent 1334d07c6a
commit 82145e0661
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 13 additions and 6 deletions

View File

@ -28,6 +28,8 @@
"flash_size": "8MB",
"maximum_ram_size": 327680,
"maximum_size": 8388608,
"use_1200bps_touch": true,
"wait_for_upload_port": true,
"require_upload_port": true,
"speed": 921600
},

View File

@ -20,6 +20,7 @@
#ifdef ARCH_PORTDUINO
#include "PortduinoGlue.h"
#include "meshUtils.h"
#include <algorithm>
#include <ctime>
#endif

View File

@ -900,7 +900,7 @@ void AdminModule::handleGetDeviceConnectionStatus(const meshtastic_MeshPacket &r
#ifdef ARCH_PORTDUINO
conn.wifi.status.is_connected = true;
#else
conn.wifi.status.is_connected = WiFi.status() != WL_CONNECTED;
conn.wifi.status.is_connected = WiFi.status() == WL_CONNECTED;
#endif
strncpy(conn.wifi.ssid, config.network.wifi_ssid, 33);
if (conn.wifi.status.is_connected) {
@ -932,10 +932,14 @@ void AdminModule::handleGetDeviceConnectionStatus(const meshtastic_MeshPacket &r
conn.has_bluetooth = true;
conn.bluetooth.pin = config.bluetooth.fixed_pin;
#ifdef ARCH_ESP32
conn.bluetooth.is_connected = nimbleBluetooth->isConnected();
conn.bluetooth.rssi = nimbleBluetooth->getRssi();
if (config.bluetooth.enabled && nimbleBluetooth) {
conn.bluetooth.is_connected = nimbleBluetooth->isConnected();
conn.bluetooth.rssi = nimbleBluetooth->getRssi();
}
#elif defined(ARCH_NRF52)
conn.bluetooth.is_connected = nrf52Bluetooth->isConnected();
if (config.bluetooth.enabled && nrf52Bluetooth) {
conn.bluetooth.is_connected = nrf52Bluetooth->isConnected();
}
#endif
#endif
conn.has_serial = true; // No serial-less devices

View File

@ -184,7 +184,7 @@ int32_t ExternalNotificationModule::runOnce()
}
#endif
// now let the PWM buzzer play
if (moduleConfig.external_notification.use_pwm) {
if (moduleConfig.external_notification.use_pwm && config.device.buzzer_gpio) {
if (rtttl::isPlaying()) {
rtttl::play();
} else if (isNagging && (nagCycleCutoff >= millis())) {

View File

@ -32,7 +32,7 @@ class ExternalNotificationModule : public SinglePortModule, private concurrency:
public:
ExternalNotificationModule();
uint32_t nagCycleCutoff = UINT32_MAX;
uint32_t nagCycleCutoff = 1;
void setExternalOn(uint8_t index = 0);
void setExternalOff(uint8_t index = 0);