Skip to content

Commit

Permalink
Merge pull request #4431 from meshtastic/2.5-changes
Browse files Browse the repository at this point in the history
2.5 Changes
  • Loading branch information
jp-bennett authored Aug 19, 2024
2 parents 6de3ca4 + 48dc222 commit e20d57f
Show file tree
Hide file tree
Showing 83 changed files with 1,938 additions and 609 deletions.
1 change: 1 addition & 0 deletions arch/esp32/esp32.ini
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ lib_deps =
https://github.com/dbSuS/libpax.git#7bcd3fcab75037505be9b122ab2b24cc5176b587
https://github.com/lewisxhe/XPowersLib.git#84b7373faea3118b6c37954d52f98b8a337148d6
https://github.com/meshtastic/ESP32_Codec2.git#633326c78ac251c059ab3a8c430fcdf25b41672f
rweather/Crypto@^0.4.0

lib_ignore =
segger_rtt
Expand Down
1 change: 1 addition & 0 deletions arch/nrf52/nrf52.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ build_src_filter =

lib_deps=
${arduino_base.lib_deps}
rweather/Crypto@^0.4.0

lib_ignore =
BluetoothOTA
1 change: 1 addition & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ extra_configs =
variants/*/platformio.ini

[env]
test_build_src = true
extra_scripts = bin/platformio-custom.py

; note: we add src to our include search path so that lmic_project_config can override
Expand Down
2 changes: 1 addition & 1 deletion src/DebugConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#define LOG_CRIT(...) SEGGER_RTT_printf(0, __VA_ARGS__)
#define LOG_TRACE(...) SEGGER_RTT_printf(0, __VA_ARGS__)
#else
#if defined(DEBUG_PORT) && !defined(DEBUG_MUTE)
#if defined(DEBUG_PORT) && !defined(DEBUG_MUTE) && !defined(PIO_UNIT_TESTING)
#define LOG_DEBUG(...) DEBUG_PORT.log(MESHTASTIC_LOG_LEVEL_DEBUG, __VA_ARGS__)
#define LOG_INFO(...) DEBUG_PORT.log(MESHTASTIC_LOG_LEVEL_INFO, __VA_ARGS__)
#define LOG_WARN(...) DEBUG_PORT.log(MESHTASTIC_LOG_LEVEL_WARN, __VA_ARGS__)
Expand Down
3 changes: 3 additions & 0 deletions src/DisplayFormatters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
const char *DisplayFormatters::getModemPresetDisplayName(meshtastic_Config_LoRaConfig_ModemPreset preset, bool useShortName)
{
switch (preset) {
case meshtastic_Config_LoRaConfig_ModemPreset_SHORT_TURBO:
return useShortName ? "ShortT" : "ShortTurbo";
break;
case meshtastic_Config_LoRaConfig_ModemPreset_SHORT_SLOW:
return useShortName ? "ShortS" : "ShortSlow";
break;
Expand Down
7 changes: 4 additions & 3 deletions src/RedirectablePrint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ size_t RedirectablePrint::write(uint8_t c)
#ifdef USE_SEGGER
SEGGER_RTT_PutChar(SEGGER_STDOUT_CH, c);
#endif

if (!config.has_lora || config.device.serial_enabled)
// Account for legacy config transition
bool serialEnabled = config.has_security ? config.security.serial_enabled : config.device.serial_enabled;
if (!config.has_lora || serialEnabled)
dest->write(c);

return 1; // We always claim one was written, rather than trusting what the
Expand Down Expand Up @@ -212,7 +213,7 @@ void RedirectablePrint::log_to_syslog(const char *logLevel, const char *format,
void RedirectablePrint::log_to_ble(const char *logLevel, const char *format, va_list arg)
{
#if !MESHTASTIC_EXCLUDE_BLUETOOTH
if (config.bluetooth.device_logging_enabled && !pauseBluetoothLogging) {
if (config.security.bluetooth_logging_enabled && !pauseBluetoothLogging) {
bool isBleConnected = false;
#ifdef ARCH_ESP32
isBleConnected = nimbleBluetooth && nimbleBluetooth->isActive() && nimbleBluetooth->isConnected();
Expand Down
4 changes: 2 additions & 2 deletions src/SerialConsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ bool SerialConsole::checkIsConnected()
bool SerialConsole::handleToRadio(const uint8_t *buf, size_t len)
{
// only talk to the API once the configuration has been loaded and we're sure the serial port is not disabled.
if (config.has_lora && config.device.serial_enabled) {
if (config.has_lora && config.security.serial_enabled) {
// Switch to protobufs for log messages
usingProtobufs = true;
canWrite = true;
Expand All @@ -96,7 +96,7 @@ bool SerialConsole::handleToRadio(const uint8_t *buf, size_t len)

void SerialConsole::log_to_serial(const char *logLevel, const char *format, va_list arg)
{
if (usingProtobufs && config.device.debug_log_enabled) {
if (usingProtobufs && config.security.debug_log_api_enabled) {
meshtastic_LogRecord_Level ll = meshtastic_LogRecord_Level_UNSET; // default to unset
switch (logLevel[0]) {
case 'D':
Expand Down
6 changes: 6 additions & 0 deletions src/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define DEFAULT_SHUTDOWN_SECONDS 2
#endif

#ifndef MINIMUM_SAFE_FREE_HEAP
#define MINIMUM_SAFE_FREE_HEAP 1500
#endif

/* Step #3: mop up with disabled values for HAS_ options not handled by the above two */

#ifndef HAS_WIFI
Expand Down Expand Up @@ -256,6 +260,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MESHTASTIC_EXCLUDE_MQTT 1
#define MESHTASTIC_EXCLUDE_POWERMON 1
#define MESHTASTIC_EXCLUDE_I2C 1
#define MESHTASTIC_EXCLUDE_PKI 1
#define MESHTASTIC_EXCLUDE_POWER_FSM 1
#define MESHTASTIC_EXCLUDE_TZ 1
#endif
Expand All @@ -280,6 +285,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MESHTASTIC_EXCLUDE_INPUTBROKER 1
#define MESHTASTIC_EXCLUDE_SERIAL 1
#define MESHTASTIC_EXCLUDE_POWERSTRESS 1
#define MESHTASTIC_EXCLUDE_ADMIN 1
#endif

// // Turn off wifi even if HW supports wifi (webserver relies on wifi and is also disabled)
Expand Down
9 changes: 5 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ void printInfo()
{
LOG_INFO("S:B:%d,%s\n", HW_VENDOR, optstr(APP_VERSION));
}

#ifndef PIO_UNIT_TESTING
void setup()
{
concurrency::hasBeenSetup = true;
Expand Down Expand Up @@ -1052,7 +1052,7 @@ void setup()
powerFSMthread = new PowerFSMThread();
setCPUFast(false); // 80MHz is fine for our slow peripherals
}

#endif
uint32_t rebootAtMsec; // If not zero we will reboot at this time (used to reboot shortly after the update completes)
uint32_t shutdownAtMsec; // If not zero we will shutdown at this time (used to shutdown from python or mobile client)

Expand All @@ -1075,7 +1075,7 @@ extern meshtastic_DeviceMetadata getDeviceMetadata()
deviceMetadata.hasRemoteHardware = moduleConfig.remote_hardware.enabled;
return deviceMetadata;
}

#ifndef PIO_UNIT_TESTING
void loop()
{
runASAP = false;
Expand Down Expand Up @@ -1120,4 +1120,5 @@ void loop()
mainDelay.delay(delayMsec);
}
// if (didWake) LOG_DEBUG("wake!\n");
}
}
#endif
Loading

0 comments on commit e20d57f

Please sign in to comment.