From 88a44eede0a10dbf291619d4cebe61839193acce Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 9 Feb 2023 07:51:41 -0600 Subject: [PATCH 01/56] Rebroadcast mode to local_only for hams --- src/modules/AdminModule.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index 553e69805..51141df43 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -604,6 +604,7 @@ void AdminModule::saveChanges(int saveWhat, bool shouldReboot) void AdminModule::handleSetHamMode(const meshtastic_HamParameters &p) { + // Set call sign and override lora limitations for licensed use strncpy(owner.long_name, p.call_sign, sizeof(owner.long_name)); owner.is_licensed = true; config.lora.override_duty_cycle = true; @@ -613,6 +614,7 @@ void AdminModule::handleSetHamMode(const meshtastic_HamParameters &p) // For FCC minimum call-sign announcement config.device.node_info_broadcast_secs = 600; + config.device.rebroadcast_mode = meshtastic_Config_DeviceConfig_RebroadcastMode_LOCAL_ONLY; // Remove PSK of primary channel for plaintext amateur usage auto primaryChannel = channels.getByIndex(channels.getPrimaryIndex()); auto &channelSettings = primaryChannel.settings; From e74b180655b8cc4561a1d459904701abedf892a8 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 9 Feb 2023 08:58:28 -0600 Subject: [PATCH 02/56] Remove setOwner's business logic for licensed operation --- src/modules/AdminModule.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index 51141df43..b76c5915a 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -212,7 +212,6 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta void AdminModule::handleSetOwner(const meshtastic_User &o) { int changed = 0; - bool licensed_changed = false; if (*o.long_name) { changed |= strcmp(owner.long_name, o.long_name); @@ -227,15 +226,12 @@ void AdminModule::handleSetOwner(const meshtastic_User &o) strncpy(owner.id, o.id, sizeof(owner.id)); } if (owner.is_licensed != o.is_licensed) { - changed = 1; - licensed_changed = true; owner.is_licensed = o.is_licensed; - config.lora.override_duty_cycle = owner.is_licensed; // override duty cycle for licensed operators } if (changed) { // If nothing really changed, don't broadcast on the network or write to flash service.reloadOwner(!hasOpenEditTransaction); - licensed_changed ? saveChanges(SEGMENT_CONFIG | SEGMENT_DEVICESTATE) : saveChanges(SEGMENT_DEVICESTATE); + saveChanges(SEGMENT_DEVICESTATE); } } From f0d27f896a55e858d3fbfcc4ee4a1883d9d154f0 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 9 Feb 2023 10:48:17 -0600 Subject: [PATCH 03/56] Add changed back --- src/modules/AdminModule.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index b76c5915a..82730b9ca 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -226,6 +226,7 @@ void AdminModule::handleSetOwner(const meshtastic_User &o) strncpy(owner.id, o.id, sizeof(owner.id)); } if (owner.is_licensed != o.is_licensed) { + changed = 1; owner.is_licensed = o.is_licensed; } From 57b8e3732e437a37432a1c1e23ccdac8624114cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Thu, 9 Feb 2023 23:33:53 +0100 Subject: [PATCH 04/56] Update to Espressif32 Platform 6.0 and ESP-IDF 5.0 --- arch/esp32/esp32.ini | 4 ++-- arch/esp32/esp32s2.ini | 4 ++-- arch/esp32/esp32s3.ini | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/esp32/esp32.ini b/arch/esp32/esp32.ini index 0011cc39f..99433b6ba 100644 --- a/arch/esp32/esp32.ini +++ b/arch/esp32/esp32.ini @@ -1,7 +1,7 @@ ; Common settings for ESP targes, mixin with extends = esp32_base [esp32_base] extends = arduino_base -platform = platformio/espressif32@^5.2.0 +platform = platformio/espressif32@^6.0.0 build_src_filter = ${arduino_base.build_src_filter} - - - - upload_speed = 921600 @@ -26,7 +26,7 @@ build_flags = -DCONFIG_NIMBLE_CPP_LOG_LEVEL=2 -DCONFIG_BT_NIMBLE_MAX_CCCDS=20 -DESP_OPENSSL_SUPPRESS_LEGACY_WARNING - -DDEBUG_HEAP + ;-DDEBUG_HEAP lib_deps = ${arduino_base.lib_deps} diff --git a/arch/esp32/esp32s2.ini b/arch/esp32/esp32s2.ini index beba16f3e..1182e6d83 100644 --- a/arch/esp32/esp32s2.ini +++ b/arch/esp32/esp32s2.ini @@ -1,6 +1,6 @@ [esp32s2_base] extends = arduino_base -platform = platformio/espressif32@^5.2.0 +platform = platformio/espressif32@^6.0.0 build_src_filter = ${arduino_base.build_src_filter} - - - - - upload_speed = 961200 @@ -27,7 +27,7 @@ build_flags = -DCONFIG_BT_NIMBLE_MAX_CCCDS=20 -DESP_OPENSSL_SUPPRESS_LEGACY_WARNING -DHAS_BLUETOOTH=0 - -DDEBUG_HEAP + ;-DDEBUG_HEAP lib_deps = ${arduino_base.lib_deps} diff --git a/arch/esp32/esp32s3.ini b/arch/esp32/esp32s3.ini index 023d1ca84..ed5127bbe 100644 --- a/arch/esp32/esp32s3.ini +++ b/arch/esp32/esp32s3.ini @@ -1,6 +1,6 @@ [esp32s3_base] extends = arduino_base -platform = platformio/espressif32@^5.2.0 +platform = platformio/espressif32@^6.0.0 build_src_filter = ${arduino_base.build_src_filter} - - - - upload_speed = 961200 @@ -26,7 +26,7 @@ build_flags = -DCONFIG_NIMBLE_CPP_LOG_LEVEL=2 -DCONFIG_BT_NIMBLE_MAX_CCCDS=20 -DESP_OPENSSL_SUPPRESS_LEGACY_WARNING - -DDEBUG_HEAP + ;-DDEBUG_HEAP lib_deps = ${arduino_base.lib_deps} From e2f5e9206d2bed9fcd482c4ca9232c94857a77b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Fri, 10 Feb 2023 01:35:25 +0100 Subject: [PATCH 05/56] label boards as secondary to split the core firmware archive by support level. Ref: https://docs.platformio.org/en/latest/scripting/examples/platformio_ini_custom_options.html --- .../platformio.ini | 1 + variants/betafpv_2400_tx_micro/platformio.ini | 1 + variants/diy/platformio.ini | 3 +++ variants/feather_diy/platformio.ini | 1 + variants/genieblocks/platformio.ini | 7 ----- variants/genieblocks/variant.h | 26 ------------------- variants/heltec_v1/platformio.ini | 1 + variants/heltec_v2.1/platformio.ini | 1 + variants/heltec_v2/platformio.ini | 1 + variants/lora_isp4520/platformio.ini | 1 + variants/lora_relay_v1/platformio.ini | 1 + variants/lora_relay_v2/platformio.ini | 1 + variants/m5stack_core/platformio.ini | 1 + variants/m5stack_coreink/platformio.ini | 1 + variants/pca10056-rc-clock/platformio.ini | 1 + variants/portduino/platformio.ini | 3 +++ variants/ppr/platformio.ini | 1 + variants/ppr1/platformio.ini | 1 + variants/rak11200/platformio.ini | 1 + variants/rpipico/platformio.ini | 1 + variants/rpipicow/platformio.ini | 1 + variants/tbeam_v07/platformio.ini | 1 + variants/tlora_v1_3/platformio.ini | 1 + variants/tlora_v2/platformio.ini | 1 + variants/wio-e5/platformio.ini | 1 + 25 files changed, 27 insertions(+), 33 deletions(-) delete mode 100644 variants/genieblocks/platformio.ini delete mode 100644 variants/genieblocks/variant.h diff --git a/variants/Dongle_nRF52840-pca10059-v1/platformio.ini b/variants/Dongle_nRF52840-pca10059-v1/platformio.ini index 027ab41d5..ea14d1a21 100644 --- a/variants/Dongle_nRF52840-pca10059-v1/platformio.ini +++ b/variants/Dongle_nRF52840-pca10059-v1/platformio.ini @@ -1,6 +1,7 @@ [env:pca10059_diy_eink] extends = nrf52840_base board = nordic_pca10059 +board_level = extra build_flags = ${nrf52840_base.build_flags} -Ivariants/Dongle_nRF52840-pca10059-v1 -D NORDIC_PCA10059 build_src_filter = ${nrf52_base.build_src_filter} +<../variants/Dongle_nRF52840-pca10059-v1> lib_deps = diff --git a/variants/betafpv_2400_tx_micro/platformio.ini b/variants/betafpv_2400_tx_micro/platformio.ini index e04f4efc2..decdb390e 100644 --- a/variants/betafpv_2400_tx_micro/platformio.ini +++ b/variants/betafpv_2400_tx_micro/platformio.ini @@ -1,6 +1,7 @@ [env:betafpv_2400_tx_micro] extends = esp32_base board = esp32doit-devkit-v1 +board_level = extra build_flags = ${esp32_base.build_flags} -D BETAFPV_2400_TX diff --git a/variants/diy/platformio.ini b/variants/diy/platformio.ini index 9a2b5d467..d50d0c4f3 100644 --- a/variants/diy/platformio.ini +++ b/variants/diy/platformio.ini @@ -2,6 +2,7 @@ [env:meshtastic-diy-v1] extends = esp32_base board = esp32doit-devkit-v1 +board_level = extra build_flags = ${esp32_base.build_flags} -D DIY_V1 @@ -13,6 +14,7 @@ build_flags = [env:meshtastic-diy-v1.1] extends = esp32_base board = esp32doit-devkit-v1 +board_level = extra build_flags = ${esp32_base.build_flags} -D DIY_V1 @@ -24,6 +26,7 @@ build_flags = [env:meshtastic-dr-dev] extends = esp32_base board = esp32doit-devkit-v1 +board_level = extra board_upload.maximum_size = 4194304 board_upload.maximum_ram_size = 532480 build_flags = diff --git a/variants/feather_diy/platformio.ini b/variants/feather_diy/platformio.ini index 84c582ab0..9b4806343 100644 --- a/variants/feather_diy/platformio.ini +++ b/variants/feather_diy/platformio.ini @@ -2,6 +2,7 @@ [env:feather_diy] extends = nrf52840_base board = adafruit_feather_nrf52840 +board_level = extra build_flags = ${nrf52840_base.build_flags} -Ivariants/feather_diy -Dfeather_diy build_src_filter = ${nrf52_base.build_src_filter} +<../variants/feather_diy> lib_deps = diff --git a/variants/genieblocks/platformio.ini b/variants/genieblocks/platformio.ini deleted file mode 100644 index b1d32277a..000000000 --- a/variants/genieblocks/platformio.ini +++ /dev/null @@ -1,7 +0,0 @@ -; The GenieBlocks LORA prototype board -; note: @geeksville disabled because genieblocks_lora is not checked into the boards directory, please send in a PR to add it ;-) -;[env:genieblocks_lora] -;extends = esp32_base -;board = genieblocks_lora -;build_flags = -; ${esp32_base.build_flags} -D GENIEBLOCKS -Ivariants/genieblocks \ No newline at end of file diff --git a/variants/genieblocks/variant.h b/variants/genieblocks/variant.h deleted file mode 100644 index 0e51e3a9e..000000000 --- a/variants/genieblocks/variant.h +++ /dev/null @@ -1,26 +0,0 @@ -#undef GPS_RX_PIN -#undef GPS_TX_PIN -#define GPS_RX_PIN 5 -#define GPS_TX_PIN 18 -#define GPS_RESET_N 10 -#define GPS_EXTINT 23 // On MAX-M8 module pin name is EXTINT. On L70 module pin name is STANDBY. - -#define BATTERY_PIN 39 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage -#define BATTERY_EN_PIN 14 // Voltage voltage divider enable pin connected to mosfet - -#define I2C_SDA 4 // I2C pins for this board -#define I2C_SCL 2 - -#define LED_PIN 12 // If defined we will blink this LED -//#define BUTTON_PIN 36 // If defined, this will be used for user button presses (ToDo problem on that line on debug screen --> -// Long press start!) #define BUTTON_NEED_PULLUP //GPIOs 34 to 39 are GPIs – input only pins. These pins don’t have internal -// pull-ups or pull-down resistors. - -#define USE_RF95 -#define LORA_DIO0 38 // a No connect on the SX1262 module -#define LORA_RESET 9 - -#define RF95_SCK 22 -#define RF95_MISO 19 -#define RF95_MOSI 13 -#define RF95_NSS 21 \ No newline at end of file diff --git a/variants/heltec_v1/platformio.ini b/variants/heltec_v1/platformio.ini index 1ed6dff84..ee10ef0f6 100644 --- a/variants/heltec_v1/platformio.ini +++ b/variants/heltec_v1/platformio.ini @@ -1,6 +1,7 @@ [env:heltec-v1] ;build_type = debug ; to make it possible to step through our jtag debugger extends = esp32_base +board_level = extra board = heltec_wifi_lora_32 build_flags = ${esp32_base.build_flags} -D HELTEC_V1 -I variants/heltec_v1 \ No newline at end of file diff --git a/variants/heltec_v2.1/platformio.ini b/variants/heltec_v2.1/platformio.ini index 5fb4c8c32..792a1bb94 100644 --- a/variants/heltec_v2.1/platformio.ini +++ b/variants/heltec_v2.1/platformio.ini @@ -2,5 +2,6 @@ ;build_type = debug ; to make it possible to step through our jtag debugger extends = esp32_base board = heltec_wifi_lora_32_V2 +board_level = extra build_flags = ${esp32_base.build_flags} -D HELTEC_V2_1 -I variants/heltec_v2.1 \ No newline at end of file diff --git a/variants/heltec_v2/platformio.ini b/variants/heltec_v2/platformio.ini index 6211437f0..8a60942a9 100644 --- a/variants/heltec_v2/platformio.ini +++ b/variants/heltec_v2/platformio.ini @@ -2,5 +2,6 @@ ;build_type = debug ; to make it possible to step through our jtag debugger extends = esp32_base board = heltec_wifi_lora_32_V2 +board_level = extra build_flags = ${esp32_base.build_flags} -D HELTEC_V2_0 -I variants/heltec_v2 \ No newline at end of file diff --git a/variants/lora_isp4520/platformio.ini b/variants/lora_isp4520/platformio.ini index fb9fdf913..9d6563515 100644 --- a/variants/lora_isp4520/platformio.ini +++ b/variants/lora_isp4520/platformio.ini @@ -1,6 +1,7 @@ [env:lora_isp4520] extends = nrf52_base board = lora_isp4520 +board_level = extra # add our variants files to the include and src paths build_flags = ${nrf52_base.build_flags} -Ivariants/lora_isp4520 diff --git a/variants/lora_relay_v1/platformio.ini b/variants/lora_relay_v1/platformio.ini index 9a73fda7c..8df7bd1d6 100644 --- a/variants/lora_relay_v1/platformio.ini +++ b/variants/lora_relay_v1/platformio.ini @@ -2,6 +2,7 @@ [env:lora-relay-v1] extends = nrf52840_base board = lora-relay-v1 +board_level = extra # add our variants files to the include and src paths # define build flags for the TFT_eSPI library build_flags = ${nrf52840_base.build_flags} -Ivariants/lora_relay_v1 diff --git a/variants/lora_relay_v2/platformio.ini b/variants/lora_relay_v2/platformio.ini index 93756c6dd..1be8ced1f 100644 --- a/variants/lora_relay_v2/platformio.ini +++ b/variants/lora_relay_v2/platformio.ini @@ -2,6 +2,7 @@ [env:lora-relay-v2] extends = nrf52840_base board = lora-relay-v2 +board_level = extra # add our variants files to the include and src paths # define build flags for the TFT_eSPI library build_flags = ${nrf52840_base.build_flags} -Ivariants/lora_relay_v2 diff --git a/variants/m5stack_core/platformio.ini b/variants/m5stack_core/platformio.ini index f84e04785..a2330922e 100644 --- a/variants/m5stack_core/platformio.ini +++ b/variants/m5stack_core/platformio.ini @@ -1,6 +1,7 @@ [env:m5stack-core] extends = esp32_base board = m5stack-core-esp32 +board_level = extra upload_port = COM8 monitor_port = COM8 monitor_filters = esp32_exception_decoder diff --git a/variants/m5stack_coreink/platformio.ini b/variants/m5stack_coreink/platformio.ini index 06f970dba..1a7926d7e 100644 --- a/variants/m5stack_coreink/platformio.ini +++ b/variants/m5stack_coreink/platformio.ini @@ -1,6 +1,7 @@ [env:m5stack-coreink] extends = esp32_base board = m5stack-coreink +board_level = extra build_src_filter = ${esp32_base.build_src_filter} build_flags = diff --git a/variants/pca10056-rc-clock/platformio.ini b/variants/pca10056-rc-clock/platformio.ini index 0dd317816..d965753d3 100644 --- a/variants/pca10056-rc-clock/platformio.ini +++ b/variants/pca10056-rc-clock/platformio.ini @@ -1,5 +1,6 @@ ; The NRF52840-dk development board, but @geeksville's board - which has a busted oscilliator [env:nrf52840dk-geeksville] +board_level = extra extends = nrf52840_base board = nrf52840_dk_modified # add our variants files to the include and src paths diff --git a/variants/portduino/platformio.ini b/variants/portduino/platformio.ini index 5bbde2adf..99e9667b6 100644 --- a/variants/portduino/platformio.ini +++ b/variants/portduino/platformio.ini @@ -2,6 +2,7 @@ extends = portduino_base build_flags = ${portduino_base.build_flags} -O0 -I variants/portduino board = cross_platform +board_level = extra lib_deps = ${portduino_base.lib_deps} build_src_filter = ${portduino_base.build_src_filter} @@ -10,6 +11,7 @@ build_src_filter = ${portduino_base.build_src_filter} extends = portduino_base build_flags = ${portduino_base.build_flags} -O0 -lgpiod -I variants/portduino board = linux_hardware +board_level = extra lib_deps = ${portduino_base.lib_deps} build_src_filter = ${portduino_base.build_src_filter} @@ -18,5 +20,6 @@ build_src_filter = ${portduino_base.build_src_filter} extends = portduino_base build_flags = ${portduino_base.build_flags} -O0 -lgpiod -I variants/portduino board = linux_arm +board_level = extra lib_deps = ${portduino_base.lib_deps} build_src_filter = ${portduino_base.build_src_filter} diff --git a/variants/ppr/platformio.ini b/variants/ppr/platformio.ini index cb7b21de4..22273ce8e 100644 --- a/variants/ppr/platformio.ini +++ b/variants/ppr/platformio.ini @@ -2,6 +2,7 @@ [env:ppr] extends = nrf52_base board = ppr +board_level = extra lib_deps = ${arduino_base.lib_deps} industruino/UC1701@^1.1.0 \ No newline at end of file diff --git a/variants/ppr1/platformio.ini b/variants/ppr1/platformio.ini index 40ad508f9..f6c2a5e0b 100644 --- a/variants/ppr1/platformio.ini +++ b/variants/ppr1/platformio.ini @@ -2,6 +2,7 @@ [env:ppr1] extends = nrf52_base board = ppr1 +board_level = extra build_flags = ${nrf52_base.build_flags} -Ivariants/ppr1 build_src_filter = ${nrf52_base.build_src_filter} +<../variants/ppr1> lib_deps = diff --git a/variants/rak11200/platformio.ini b/variants/rak11200/platformio.ini index 602f5a246..f653adeb2 100644 --- a/variants/rak11200/platformio.ini +++ b/variants/rak11200/platformio.ini @@ -1,5 +1,6 @@ [env:rak11200] extends = esp32_base +board_level = extra board = wiscore_rak11200 build_flags = ${esp32_base.build_flags} -D RAK_11200 -I variants/rak11200 diff --git a/variants/rpipico/platformio.ini b/variants/rpipico/platformio.ini index 122fbd42f..a169e8a9d 100644 --- a/variants/rpipico/platformio.ini +++ b/variants/rpipico/platformio.ini @@ -1,6 +1,7 @@ [env:pico] extends = rp2040_base board = rpipico +board_level = extra upload_protocol = picotool # add our variants files to the include and src paths diff --git a/variants/rpipicow/platformio.ini b/variants/rpipicow/platformio.ini index 697ec1caa..6e5c32a52 100644 --- a/variants/rpipicow/platformio.ini +++ b/variants/rpipicow/platformio.ini @@ -1,6 +1,7 @@ [env:picow] extends = rp2040_base board = rpipicow +board_level = extra upload_protocol = picotool # add our variants files to the include and src paths diff --git a/variants/tbeam_v07/platformio.ini b/variants/tbeam_v07/platformio.ini index b63184137..22258b64c 100644 --- a/variants/tbeam_v07/platformio.ini +++ b/variants/tbeam_v07/platformio.ini @@ -2,5 +2,6 @@ [env:tbeam0.7] extends = esp32_base board = ttgo-t-beam +board_level = extra build_flags = ${esp32_base.build_flags} -D TBEAM_V07 -I variants/tbeam_v07 \ No newline at end of file diff --git a/variants/tlora_v1_3/platformio.ini b/variants/tlora_v1_3/platformio.ini index 9d9f41a7c..739f76268 100644 --- a/variants/tlora_v1_3/platformio.ini +++ b/variants/tlora_v1_3/platformio.ini @@ -1,5 +1,6 @@ [env:tlora_v1_3] extends = esp32_base +board_level = extra board = ttgo-lora32-v1 build_flags = ${esp32_base.build_flags} -D TLORA_V1_3 -I variants/tlora_v1_3 \ No newline at end of file diff --git a/variants/tlora_v2/platformio.ini b/variants/tlora_v2/platformio.ini index 8710068af..25ae3a360 100644 --- a/variants/tlora_v2/platformio.ini +++ b/variants/tlora_v2/platformio.ini @@ -1,5 +1,6 @@ [env:tlora-v2] extends = esp32_base board = ttgo-lora32-v1 +board_level = extra build_flags = ${esp32_base.build_flags} -D TLORA_V2 -I variants/tlora_v2 \ No newline at end of file diff --git a/variants/wio-e5/platformio.ini b/variants/wio-e5/platformio.ini index 0050d4118..32436dae8 100644 --- a/variants/wio-e5/platformio.ini +++ b/variants/wio-e5/platformio.ini @@ -1,4 +1,5 @@ [env:wio-e5] extends = stm32wl5e_base +board_level = extra build_flags = ${stm32wl5e_base.build_flags} -Ivariants/wio-e5 -DHAL_DAC_MODULE_ONLY -DSERIAL_UART_INSTANCE=1 -DPIN_SERIAL_RX=PB7 -DPIN_SERIAL_TX=PB6 From 4967a16abe622e5a7beb7b6f78d47f1cc3de48a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Fri, 17 Feb 2023 12:31:51 +0100 Subject: [PATCH 06/56] - Abstract the memory stats into its own class. - Fix a bug with debug mqtt - nrf52 needs more love, there's a strange error while linking. Help appreciated --- src/Power.cpp | 14 ++++---- src/concurrency/OSThread.cpp | 5 +-- src/main.cpp | 8 ++--- src/main.h | 1 + src/memGet.cpp | 46 ++++++++++++++++++++++++ src/memGet.h | 18 ++++++++++ src/mesh/http/ContentHandler.cpp | 8 ++--- src/modules/esp32/StoreForwardModule.cpp | 16 +++++---- 8 files changed, 91 insertions(+), 25 deletions(-) create mode 100644 src/memGet.cpp create mode 100644 src/memGet.h diff --git a/src/Power.cpp b/src/Power.cpp index f84c7b71d..dac26e971 100644 --- a/src/Power.cpp +++ b/src/Power.cpp @@ -198,7 +198,7 @@ Power::Power() : OSThread("Power") statusHandler = {}; low_voltage_counter = 0; #ifdef DEBUG_HEAP - lastheap = ESP.getFreeHeap(); + lastheap = memGet.getFreeHeap(); #endif } @@ -302,7 +302,7 @@ void Power::readPowerStatus() powerStatus2.getIsCharging(), powerStatus2.getBatteryVoltageMv(), powerStatus2.getBatteryChargePercent()); newStatus.notifyObservers(&powerStatus2); #ifdef DEBUG_HEAP - if (lastheap != ESP.getFreeHeap()) { + if (lastheap != memGet.getFreeHeap()) { LOG_DEBUG("Threads running:"); int running = 0; for (int i = 0; i < MAX_THREADS; i++) { @@ -313,9 +313,9 @@ void Power::readPowerStatus() } } LOG_DEBUG("\n"); - LOG_DEBUG("Heap status: %d/%d bytes free (%d), running %d/%d threads\n", ESP.getFreeHeap(), ESP.getHeapSize(), - ESP.getFreeHeap() - lastheap, running, concurrency::mainController.size(false)); - lastheap = ESP.getFreeHeap(); + LOG_DEBUG("Heap status: %d/%d bytes free (%d), running %d/%d threads\n", memGet.getFreeHeap(), memGet.getHeapSize(), + memGet.getFreeHeap() - lastheap, running, concurrency::mainController.size(false)); + lastheap = memGet.getFreeHeap(); } #ifdef DEBUG_HEAP_MQTT if (mqtt) { @@ -324,11 +324,11 @@ void Power::readPowerStatus() getMacAddr(dmac); // Get our hardware ID char mac[18]; sprintf(mac, "!%02x%02x%02x%02x", dmac[2], dmac[3], dmac[4], dmac[5]); - auto newHeap = ESP.getFreeHeap(); + auto newHeap = memGet.getFreeHeap(); std::string heapTopic = "msh/2/heap/" + std::string(mac); std::string heapString = std::to_string(newHeap); mqtt->pubSub.publish(heapTopic.c_str(), heapString.c_str(), false); - // auto fragHeap = ESP.getHeapFragmentation(); + // auto fragHeap = memGet.getHeapFragmentation(); auto wifiRSSI = WiFi.RSSI(); heapTopic = "msh/2/wifi/" + std::string(mac); std::string wifiString = std::to_string(wifiRSSI); diff --git a/src/concurrency/OSThread.cpp b/src/concurrency/OSThread.cpp index af50d28f5..c71d3510e 100644 --- a/src/concurrency/OSThread.cpp +++ b/src/concurrency/OSThread.cpp @@ -1,5 +1,6 @@ #include "OSThread.h" #include "configuration.h" +#include "memGet.h" #include namespace concurrency @@ -75,12 +76,12 @@ bool OSThread::shouldRun(unsigned long time) void OSThread::run() { #ifdef DEBUG_HEAP - auto heap = ESP.getFreeHeap(); + auto heap = memGet.getFreeHeap(); #endif currentThread = this; auto newDelay = runOnce(); #ifdef DEBUG_HEAP - auto newHeap = ESP.getFreeHeap(); + auto newHeap = memGet.getFreeHeap(); if (newHeap < heap) LOG_DEBUG("------ Thread %s leaked heap %d -> %d (%d) ------\n", ThreadName.c_str(), heap, newHeap, newHeap - heap); if (heap < newHeap) diff --git a/src/main.cpp b/src/main.cpp index 89148c22b..9f907aee0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -134,16 +134,14 @@ static int32_t ledBlinker() setLed(ledOn); -#ifdef ARCH_ESP32 - auto newHeap = ESP.getFreeHeap(); - if (newHeap < 11000) { - LOG_DEBUG("\n\n====== heap too low [11000] -> reboot in 1s ======\n\n"); + auto newHeap = memGet.getFreeHeap(); + if (newHeap < 10000) { + LOG_DEBUG("\n\n====== heap too low [10000] -> reboot in 1s ======\n\n"); #ifdef HAS_SCREEN screen->startRebootScreen(); #endif rebootAtMsec = millis() + 900; } -#endif // have a very sparse duty cycle of LED being on, unless charging, then blink 0.5Hz square wave rate to indicate that return powerStatus->getIsCharging() ? 1000 : (ledOn ? 1 : 1000); diff --git a/src/main.h b/src/main.h index b1bee1b06..66de776da 100644 --- a/src/main.h +++ b/src/main.h @@ -4,6 +4,7 @@ #include "NodeStatus.h" #include "PowerStatus.h" #include "graphics/Screen.h" +#include "memGet.h" #include "mesh/generated/meshtastic/telemetry.pb.h" #include #if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) diff --git a/src/memGet.cpp b/src/memGet.cpp new file mode 100644 index 000000000..9f59d29ff --- /dev/null +++ b/src/memGet.cpp @@ -0,0 +1,46 @@ +#include "memGet.h" +#include "configuration.h" + +MemGet memGet; + +uint32_t MemGet::getFreeHeap() +{ +#ifdef ARCH_ESP32 + return ESP.getFreeHeap(); +#elif defined(ARCH_NRF52) + return dbgHeapFree(); +#else + // this platform does not have heap management function implemented + return UINT32_MAX; +#endif +} + +uint32_t MemGet::getHeapSize() +{ +#ifdef ARCH_ESP32 + return ESP.getHeapSize(); +#elif defined(ARCH_NRF52) + return dbgHeapTotal(); +#else + // this platform does not have heap management function implemented + return UINT32_MAX; +#endif +} + +uint32_t MemGet::getFreePsram() +{ +#ifdef ARCH_ESP32 + return ESP.getFreePsram(); +#else + return 0; +#endif +} + +uint32_t MemGet::getPsramSize() +{ +#ifdef ARCH_ESP32 + return ESP.getPsramSize(); +#else + return 0; +#endif +} diff --git a/src/memGet.h b/src/memGet.h new file mode 100644 index 000000000..130d2ca7e --- /dev/null +++ b/src/memGet.h @@ -0,0 +1,18 @@ +#pragma once +#ifndef _MT_MEMGET_H +#define _MT_MEMGET_H + +#include + +class MemGet +{ + public: + uint32_t getFreeHeap(); + uint32_t getHeapSize(); + uint32_t getFreePsram(); + uint32_t getPsramSize(); +}; + +extern MemGet memGet; + +#endif diff --git a/src/mesh/http/ContentHandler.cpp b/src/mesh/http/ContentHandler.cpp index 8683f9cb1..c77dae1c7 100644 --- a/src/mesh/http/ContentHandler.cpp +++ b/src/mesh/http/ContentHandler.cpp @@ -622,10 +622,10 @@ void handleReport(HTTPRequest *req, HTTPResponse *res) // data->memory JSONObject jsonObjMemory; - jsonObjMemory["heap_total"] = new JSONValue((int)ESP.getHeapSize()); - jsonObjMemory["heap_free"] = new JSONValue((int)ESP.getFreeHeap()); - jsonObjMemory["psram_total"] = new JSONValue((int)ESP.getPsramSize()); - jsonObjMemory["psram_free"] = new JSONValue((int)ESP.getFreePsram()); + jsonObjMemory["heap_total"] = new JSONValue((int)memGet.getHeapSize()); + jsonObjMemory["heap_free"] = new JSONValue((int)memGet.getFreeHeap()); + jsonObjMemory["psram_total"] = new JSONValue((int)memGet.getPsramSize()); + jsonObjMemory["psram_free"] = new JSONValue((int)memGet.getFreePsram()); jsonObjMemory["fs_total"] = new JSONValue((int)FSCom.totalBytes()); jsonObjMemory["fs_used"] = new JSONValue((int)FSCom.usedBytes()); jsonObjMemory["fs_free"] = new JSONValue(int(FSCom.totalBytes() - FSCom.usedBytes())); diff --git a/src/modules/esp32/StoreForwardModule.cpp b/src/modules/esp32/StoreForwardModule.cpp index fbebc77e8..38e983669 100644 --- a/src/modules/esp32/StoreForwardModule.cpp +++ b/src/modules/esp32/StoreForwardModule.cpp @@ -5,6 +5,7 @@ #include "Router.h" #include "airtime.h" #include "configuration.h" +#include "memGet.h" #include "mesh-pb-constants.h" #include "mesh/generated/meshtastic/storeforward.pb.h" #include "modules/ModuleDev.h" @@ -63,8 +64,8 @@ void StoreForwardModule::populatePSRAM() https://learn.upesy.com/en/programmation/psram.html#psram-tab */ - LOG_DEBUG("*** Before PSRAM initilization: heap %d/%d PSRAM %d/%d\n", ESP.getFreeHeap(), ESP.getHeapSize(), - ESP.getFreePsram(), ESP.getPsramSize()); + LOG_DEBUG("*** Before PSRAM initilization: heap %d/%d PSRAM %d/%d\n", memGet.getFreeHeap(), memGet.getHeapSize(), + memGet.getFreePsram(), memGet.getPsramSize()); this->packetHistoryTXQueue = static_cast(ps_calloc(this->historyReturnMax, sizeof(PacketHistoryStruct))); @@ -72,13 +73,14 @@ void StoreForwardModule::populatePSRAM() /* Use a maximum of 2/3 the available PSRAM unless otherwise specified. Note: This needs to be done after every thing that would use PSRAM */ - uint32_t numberOfPackets = (this->records ? this->records : (((ESP.getFreePsram() / 3) * 2) / sizeof(PacketHistoryStruct))); + uint32_t numberOfPackets = + (this->records ? this->records : (((memGet.getFreePsram() / 3) * 2) / sizeof(PacketHistoryStruct))); this->records = numberOfPackets; this->packetHistory = static_cast(ps_calloc(numberOfPackets, sizeof(PacketHistoryStruct))); - LOG_DEBUG("*** After PSRAM initilization: heap %d/%d PSRAM %d/%d\n", ESP.getFreeHeap(), ESP.getHeapSize(), ESP.getFreePsram(), - ESP.getPsramSize()); + LOG_DEBUG("*** After PSRAM initilization: heap %d/%d PSRAM %d/%d\n", memGet.getFreeHeap(), memGet.getHeapSize(), + memGet.getFreePsram(), memGet.getPsramSize()); LOG_DEBUG("*** numberOfPackets for packetHistory - %u\n", numberOfPackets); } @@ -445,8 +447,8 @@ StoreForwardModule::StoreForwardModule() if ((config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER) || (config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER_CLIENT)) { LOG_INFO("*** Initializing Store & Forward Module in Router mode\n"); - if (ESP.getPsramSize() > 0) { - if (ESP.getFreePsram() >= 1024 * 1024) { + if (memGet.getPsramSize() > 0) { + if (memGet.getFreePsram() >= 1024 * 1024) { // Do the startup here From c2ff6f2f7c2a408dd56c0958a8e3c6255ca0c109 Mon Sep 17 00:00:00 2001 From: thebentern Date: Fri, 17 Feb 2023 12:50:01 +0000 Subject: [PATCH 07/56] [create-pull-request] automated change --- protobufs | 2 +- src/mesh/generated/meshtastic/mesh.pb.h | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/protobufs b/protobufs index cb01d7472..05f49816c 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit cb01d7472fc22321652a5471155dfc6c04a612ab +Subproject commit 05f49816cd8d7d405e052753f0aee8275cf33d36 diff --git a/src/mesh/generated/meshtastic/mesh.pb.h b/src/mesh/generated/meshtastic/mesh.pb.h index 25e5fbf05..1f9804749 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.h +++ b/src/mesh/generated/meshtastic/mesh.pb.h @@ -57,9 +57,13 @@ typedef enum _meshtastic_HardwareModel { meshtastic_HardwareModel_TLORA_V2_1_1P8 = 15, /* TODO: REPLACE */ meshtastic_HardwareModel_TLORA_T3_S3 = 16, + /* B&Q Consulting Nano G1 Explorer: https://wiki.uniteng.com/en/meshtastic/nano-g1-explorer */ + meshtastic_HardwareModel_NANO_G1_EXPLORER = 17, /* B&Q Consulting Station Edition G1: https://uniteng.com/wiki/doku.php?id=meshtastic:station */ meshtastic_HardwareModel_STATION_G1 = 25, - /* Less common/prototype boards listed here (needs one more byte over the air) */ + /* --------------------------------------------------------------------------- + Less common/prototype boards listed here (needs one more byte over the air) + --------------------------------------------------------------------------- */ meshtastic_HardwareModel_LORA_RELAY_V1 = 32, /* TODO: REPLACE */ meshtastic_HardwareModel_NRF52840DK = 33, @@ -89,9 +93,9 @@ typedef enum _meshtastic_HardwareModel { meshtastic_HardwareModel_BETAFPV_2400_TX = 45, /* BetaFPV ExpressLRS "Nano" TX Module 900MHz with ESP32 CPU */ meshtastic_HardwareModel_BETAFPV_900_NANO_TX = 46, - /* B&Q Consulting Nano G1 Explorer: https://wiki.uniteng.com/en/meshtastic/nano-g1-explorer */ - meshtastic_HardwareModel_NANO_G1_EXPLORER = 47, - /* 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. + ------------------------------------------------------------------------------------------------------------------------------------------ */ meshtastic_HardwareModel_PRIVATE_HW = 255 } meshtastic_HardwareModel; From 090f42f51f8dfacbd50c17160d5239a4337fce02 Mon Sep 17 00:00:00 2001 From: neil Date: Sat, 18 Feb 2023 04:49:37 +0800 Subject: [PATCH 08/56] 'nano-g1-explorer' --- .vscode/extensions.json | 7 +++-- src/platform/esp32/architecture.h | 2 ++ variants/nano-g1-explorer/platformio.ini | 8 +++++ variants/nano-g1-explorer/variant.h | 37 ++++++++++++++++++++++++ 4 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 variants/nano-g1-explorer/platformio.ini create mode 100644 variants/nano-g1-explorer/variant.h diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 4fc84fa78..080e70d08 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -2,8 +2,9 @@ // See http://go.microsoft.com/fwlink/?LinkId=827846 // for the documentation about the extensions.json format "recommendations": [ - "ms-vscode.cpptools", - "platformio.platformio-ide", - "trunk.io" + "platformio.platformio-ide" ], + "unwantedRecommendations": [ + "ms-vscode.cpptools-extension-pack" + ] } diff --git a/src/platform/esp32/architecture.h b/src/platform/esp32/architecture.h index 90c016dae..edd16ebbd 100644 --- a/src/platform/esp32/architecture.h +++ b/src/platform/esp32/architecture.h @@ -95,6 +95,8 @@ #define HW_VENDOR meshtastic_HardwareModel_TLORA_T3_S3 #elif defined(BETAFPV_2400_TX) #define HW_VENDOR meshtastic_HardwareModel_BETAFPV_2400_TX +#elif defined(NANO_G1_EXPLORER) +#define HW_VENDOR meshtastic_HardwareModel_NANO_G1_EXPLORER #endif // diff --git a/variants/nano-g1-explorer/platformio.ini b/variants/nano-g1-explorer/platformio.ini new file mode 100644 index 000000000..22037cbc9 --- /dev/null +++ b/variants/nano-g1-explorer/platformio.ini @@ -0,0 +1,8 @@ +; The 1.0 release of the nano-g1-explorer board +[env:nano-g1-explorer] +extends = esp32_base +board = ttgo-t-beam +lib_deps = + ${esp32_base.lib_deps} +build_flags = + ${esp32_base.build_flags} -D NANO_G1_EXPLORER -I variants/nano-g1-explorer \ No newline at end of file diff --git a/variants/nano-g1-explorer/variant.h b/variants/nano-g1-explorer/variant.h new file mode 100644 index 000000000..df8a0aad9 --- /dev/null +++ b/variants/nano-g1-explorer/variant.h @@ -0,0 +1,37 @@ +// #define BUTTON_NEED_PULLUP // if set we need to turn on the internal CPU pullup during sleep + +#define I2C_SDA 21 +#define I2C_SCL 22 + +#define BUTTON_PIN 36 // The user button (information button) GPIO on the Nano G1 explorer +//#define BUTTON_PIN_ALT 13 // Alternate GPIO for an external button if needed. Does anyone use this? It is not documented +// anywhere. +#define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module. + +// common pinout for their SX1262 vs RF95 modules - both can be enabled and we will probe at runtime for RF95 and if +// not found then probe for SX1262 +#define USE_RF95 +#define USE_SX1262 + +#define LORA_DIO0 26 // a No connect on the SX1262 module +#define LORA_RESET 23 +#define LORA_DIO1 33 // SX1262 IRQ +#define LORA_DIO2 32 // SX1262 BUSY +#define LORA_DIO3 // Not connected on PCB + +#ifdef USE_SX1262 +#define SX126X_CS RF95_NSS // FIXME - we really should define LORA_CS instead +#define SX126X_DIO1 LORA_DIO1 +#define SX126X_BUSY LORA_DIO2 +#define SX126X_RESET LORA_RESET +#define SX126X_E22 // Not really an E22 +// Internally the module hooks the SX1262-DIO2 in to control the TX/RX switch (which is the default for the sx1262interface +// code) +#endif + +#define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage +#define BATTERY_SENSE_SAMPLES 15 // Set the number of samples, It has an effect of increasing sensitivity. +#define ADC_MULTIPLIER 2 + +//#define USE_SH1107 // Finally we will use SH1107 128x64 resolution driver, because SH1106 will shift the screen by 2 lines. +#define USE_SH1106 \ No newline at end of file From fa371bc84439abfe90aed80fa325cb470767daf4 Mon Sep 17 00:00:00 2001 From: Neil Hao Date: Sat, 18 Feb 2023 05:00:43 +0800 Subject: [PATCH 09/56] Update extensions.json --- .vscode/extensions.json | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 080e70d08..4fc84fa78 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -2,9 +2,8 @@ // See http://go.microsoft.com/fwlink/?LinkId=827846 // for the documentation about the extensions.json format "recommendations": [ - "platformio.platformio-ide" + "ms-vscode.cpptools", + "platformio.platformio-ide", + "trunk.io" ], - "unwantedRecommendations": [ - "ms-vscode.cpptools-extension-pack" - ] } From 3f5c0cb6ac1a99b8db1c59290f50ee2872c194b2 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 18 Feb 2023 18:32:46 -0600 Subject: [PATCH 10/56] Don't auto set to default primary channel --- src/mesh/NodeDB.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 5c28f5261..9702fb5f2 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -235,11 +235,6 @@ void NodeDB::installRoleDefaults(meshtastic_Config_DeviceConfig_Role role) initModuleConfigIntervals(); } else if (role == meshtastic_Config_DeviceConfig_Role_REPEATER) { config.display.screen_on_secs = 1; - meshtastic_Channel &ch = channels.getByIndex(channels.getPrimaryIndex()); - meshtastic_ChannelSettings &channelSettings = ch.settings; - uint8_t defaultpskIndex = 1; - channelSettings.psk.bytes[0] = defaultpskIndex; - channelSettings.psk.size = 1; } else if (role == meshtastic_Config_DeviceConfig_Role_TRACKER) { config.position.position_broadcast_smart_enabled = false; config.position.position_broadcast_secs = 120; From 01042460674679d0d844c6a2db10b34fcd008d0a Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Mon, 20 Feb 2023 07:20:14 -0600 Subject: [PATCH 11/56] Remove pico from build for now --- .github/workflows/main_matrix.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index fb01f3208..aa28eb164 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -92,16 +92,16 @@ jobs: with: board: ${{ matrix.board }} - build-rpi2040: - strategy: - fail-fast: false - max-parallel: 2 - matrix: - include: - - board: pico - uses: ./.github/workflows/build_rpi2040.yml - with: - board: ${{ matrix.board }} + # build-rpi2040: + # strategy: + # fail-fast: false + # max-parallel: 2 + # matrix: + # include: + # - board: pico + # uses: ./.github/workflows/build_rpi2040.yml + # with: + # board: ${{ matrix.board }} build-native: runs-on: ubuntu-latest From 462ee3d921ebc3fd91814dcc9d54ceee128db60d Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Mon, 20 Feb 2023 07:22:33 -0600 Subject: [PATCH 12/56] Missed a reference --- .github/workflows/main_matrix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index aa28eb164..9b5baafdb 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -175,7 +175,7 @@ jobs: gather-artifacts: runs-on: ubuntu-latest - needs: [build-esp32, build-nrf52, build-native, build-rpi2040] + needs: [build-esp32, build-nrf52, build-native] #, build-rpi2040] steps: - name: Checkout code uses: actions/checkout@v3 From 83a201fe86462d9048b9211c7339e9e7dfdc5d72 Mon Sep 17 00:00:00 2001 From: GUVWAF <78759985+GUVWAF@users.noreply.github.com> Date: Mon, 20 Feb 2023 14:40:44 +0100 Subject: [PATCH 13/56] Use LORA_DIO1 as RadioLib GPIO for SX127x chips (#2290) * When channel is active, first try receiving that packet Afterwards we'll try transmitting again * Remove setStandby in startSend Already done in isChannelActive() * Set LORA_DIO1 as RadioLib GPIO for SX127x * LORA_DIO1 for Heltec v1, overlaps with GPS_TX Set to RADIOLIB_NC for now * If receive was not successful, startReceive doesn't trigger the interrupt So we have to go back to transmitting anyway --------- Co-authored-by: Ben Meadors --- src/RF95Configuration.h | 2 +- src/main.cpp | 2 +- src/mesh/RF95Interface.cpp | 5 +++-- src/mesh/RF95Interface.h | 2 +- src/mesh/RadioLibInterface.cpp | 7 +++---- variants/heltec_v1/variant.h | 4 ++-- variants/heltec_v2.1/variant.h | 2 +- variants/heltec_v2/variant.h | 2 +- variants/tbeam_v07/variant.h | 2 +- variants/tlora_v1/variant.h | 4 ++-- variants/tlora_v1_3/variant.h | 4 ++-- variants/tlora_v2/variant.h | 4 ++-- variants/tlora_v2_1_16/variant.h | 2 ++ 13 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/RF95Configuration.h b/src/RF95Configuration.h index f304aadd0..66b2dcf86 100644 --- a/src/RF95Configuration.h +++ b/src/RF95Configuration.h @@ -2,6 +2,6 @@ #ifdef USE_RF95 #define RF95_RESET LORA_RESET #define RF95_IRQ LORA_DIO0 // on SX1262 version this is a no connect DIO0 -#define RF95_DIO1 LORA_DIO1 // Note: not really used for RF95 +#define RF95_DIO1 LORA_DIO1 // Note: not really used for RF95, but used for pure SX127x #define RF95_DIO2 LORA_DIO2 // Note: not really used for RF95 #endif \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 2bd153ea5..3818d878e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -407,7 +407,7 @@ void setup() #if defined(RF95_IRQ) if (!rIf) { - rIf = new RF95Interface(RF95_NSS, RF95_IRQ, RF95_RESET, SPI); + rIf = new RF95Interface(RF95_NSS, RF95_IRQ, RF95_RESET, RF95_DIO1, SPI); if (!rIf->init()) { LOG_WARN("Failed to find RF95 radio\n"); delete rIf; diff --git a/src/mesh/RF95Interface.cpp b/src/mesh/RF95Interface.cpp index 2e378aacb..498727639 100644 --- a/src/mesh/RF95Interface.cpp +++ b/src/mesh/RF95Interface.cpp @@ -11,8 +11,9 @@ #define POWER_DEFAULT 17 // How much power to use if the user hasn't set a power level -RF95Interface::RF95Interface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, SPIClass &spi) - : RadioLibInterface(cs, irq, rst, RADIOLIB_NC, spi) +RF95Interface::RF95Interface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE busy, + SPIClass &spi) + : RadioLibInterface(cs, irq, rst, busy, spi) { // FIXME - we assume devices never get destroyed } diff --git a/src/mesh/RF95Interface.h b/src/mesh/RF95Interface.h index 9851020d9..96c3f2476 100644 --- a/src/mesh/RF95Interface.h +++ b/src/mesh/RF95Interface.h @@ -12,7 +12,7 @@ class RF95Interface : public RadioLibInterface RadioLibRF95 *lora = NULL; // Either a RFM95 or RFM96 depending on what was stuffed on this board public: - RF95Interface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, SPIClass &spi); + RF95Interface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE busy, SPIClass &spi); // TODO: Verify that this irq flag works with RFM95 / SX1276 radios the way it used to bool isIRQPending() override { return lora->getIRQFlags() & RADIOLIB_SX127X_MASK_IRQ_FLAG_VALID_HEADER; } diff --git a/src/mesh/RadioLibInterface.cpp b/src/mesh/RadioLibInterface.cpp index ef69f722c..c624bc168 100644 --- a/src/mesh/RadioLibInterface.cpp +++ b/src/mesh/RadioLibInterface.cpp @@ -218,8 +218,9 @@ void RadioLibInterface::onNotify(uint32_t notification) setTransmitDelay(); // currently Rx/Tx-ing: reset random delay } else { if (isChannelActive()) { // check if there is currently a LoRa packet on the channel - // LOG_DEBUG("Channel is active: set random delay\n"); - setTransmitDelay(); // reset random delay + // LOG_DEBUG("Channel is active, try receiving first.\n"); + startReceive(); // try receiving this packet, afterwards we'll be trying to transmit again + setTransmitDelay(); } else { // Send any outgoing packets we have ready meshtastic_MeshPacket *txp = txQueue.dequeue(); @@ -388,8 +389,6 @@ void RadioLibInterface::startSend(meshtastic_MeshPacket *txp) LOG_WARN("startSend is dropping tx packet because we are disabled\n"); packetPool.release(txp); } else { - setStandby(); // Cancel any already in process receives - configHardwareForSend(); // must be after setStandby size_t numbytes = beginSending(txp); diff --git a/variants/heltec_v1/variant.h b/variants/heltec_v1/variant.h index 50a786623..948f6ff1e 100644 --- a/variants/heltec_v1/variant.h +++ b/variants/heltec_v1/variant.h @@ -20,8 +20,8 @@ #ifndef USE_JTAG #define LORA_RESET 14 #endif -#define LORA_DIO1 35 // Not really used -#define LORA_DIO2 34 // Not really used +#define LORA_DIO1 RADIOLIB_NC +#define LORA_DIO2 32 // Not really used // ratio of voltage divider = 3.20 (R1=100k, R2=220k) #define ADC_MULTIPLIER 3.2 diff --git a/variants/heltec_v2.1/variant.h b/variants/heltec_v2.1/variant.h index 884ad83d6..39a0e677f 100644 --- a/variants/heltec_v2.1/variant.h +++ b/variants/heltec_v2.1/variant.h @@ -24,7 +24,7 @@ #ifndef USE_JTAG #define LORA_RESET 14 #endif -#define LORA_DIO1 35 // Not really used +#define LORA_DIO1 35 // https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-3/18436 #define LORA_DIO2 34 // Not really used #define ADC_MULTIPLIER 3.8 diff --git a/variants/heltec_v2/variant.h b/variants/heltec_v2/variant.h index 893ee320f..59e0c76e6 100644 --- a/variants/heltec_v2/variant.h +++ b/variants/heltec_v2/variant.h @@ -21,7 +21,7 @@ #ifndef USE_JTAG #define LORA_RESET 14 #endif -#define LORA_DIO1 35 // Not really used +#define LORA_DIO1 35 // https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-3/18436 #define LORA_DIO2 34 // Not really used // ratio of voltage divider = 3.20 (R12=100k, R10=220k) diff --git a/variants/tbeam_v07/variant.h b/variants/tbeam_v07/variant.h index ac7776c1a..2c8008688 100644 --- a/variants/tbeam_v07/variant.h +++ b/variants/tbeam_v07/variant.h @@ -10,7 +10,7 @@ #define USE_RF95 #define LORA_DIO0 26 // a No connect on the SX1262 module #define LORA_RESET 23 -#define LORA_DIO1 33 // Not really used +#define LORA_DIO1 33 #define LORA_DIO2 32 // Not really used // This board has different GPS pins than all other boards diff --git a/variants/tlora_v1/variant.h b/variants/tlora_v1/variant.h index c390a3438..b4365a443 100644 --- a/variants/tlora_v1/variant.h +++ b/variants/tlora_v1/variant.h @@ -15,5 +15,5 @@ #define USE_RF95 #define LORA_DIO0 26 // a No connect on the SX1262 module #define LORA_RESET 14 -#define LORA_DIO1 35 // Not really used -#define LORA_DIO2 34 // Not really used +#define LORA_DIO1 33 // Must be manually wired: https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-3/18436 +#define LORA_DIO2 32 // Not really used diff --git a/variants/tlora_v1_3/variant.h b/variants/tlora_v1_3/variant.h index f5240d140..7e8aec0c4 100644 --- a/variants/tlora_v1_3/variant.h +++ b/variants/tlora_v1_3/variant.h @@ -18,5 +18,5 @@ #define USE_RF95 #define LORA_DIO0 26 // a No connect on the SX1262 module #define LORA_RESET 14 -#define LORA_DIO1 35 // Not really used -#define LORA_DIO2 34 // Not really used \ No newline at end of file +#define LORA_DIO1 33 // Prob. must be manually wired: https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-3/18436 +#define LORA_DIO2 32 // Not really used \ No newline at end of file diff --git a/variants/tlora_v2/variant.h b/variants/tlora_v2/variant.h index 0c854e37a..f18503139 100644 --- a/variants/tlora_v2/variant.h +++ b/variants/tlora_v2/variant.h @@ -18,5 +18,5 @@ #define USE_RF95 #define LORA_DIO0 26 // a No connect on the SX1262 module #define LORA_RESET 14 -#define LORA_DIO1 35 // Not really used -#define LORA_DIO2 34 // Not really used +#define LORA_DIO1 33 // Must be manually wired: https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-3/18436 +#define LORA_DIO2 32 // Not really used diff --git a/variants/tlora_v2_1_16/variant.h b/variants/tlora_v2_1_16/variant.h index 74b82d8c1..11c5921ba 100644 --- a/variants/tlora_v2_1_16/variant.h +++ b/variants/tlora_v2_1_16/variant.h @@ -18,3 +18,5 @@ #define USE_RF95 #define LORA_DIO0 26 // a No connect on the SX1262 module #define LORA_RESET 23 +#define LORA_DIO1 33 // https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-3/18436 +#define LORA_DIO2 32 // Not really used From 25fd9d2d1d48f50d6e1929472833bbe86c109bdc Mon Sep 17 00:00:00 2001 From: Krezalis Date: Mon, 20 Feb 2023 18:03:13 +0200 Subject: [PATCH 14/56] Add Ukrainian symbols (#2286) * Update Screen.cpp * Add files via upload * Update Screen.cpp --------- Co-authored-by: Ben Meadors --- src/graphics/Screen.cpp | 8 + src/graphics/fonts/OLEDDisplayFontsUA.cpp | 424 ++++++++++++++++++++++ src/graphics/fonts/OLEDDisplayFontsUA.h | 11 + 3 files changed, 443 insertions(+) create mode 100644 src/graphics/fonts/OLEDDisplayFontsUA.cpp create mode 100644 src/graphics/fonts/OLEDDisplayFontsUA.h diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index c5b428537..c935c354f 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -50,6 +50,10 @@ along with this program. If not, see . #include "fonts/OLEDDisplayFontsRU.h" #endif +#ifdef OLED_UA +#include "fonts/OLEDDisplayFontsUA.h" +#endif + using namespace meshtastic; /** @todo remove */ namespace graphics @@ -106,8 +110,12 @@ static uint16_t displayWidth, displayHeight; #ifdef OLED_RU #define FONT_SMALL ArialMT_Plain_10_RU #else +#ifdef OLED_UA +#define FONT_SMALL ArialMT_Plain_10_UA +#else #define FONT_SMALL ArialMT_Plain_10 // Height: 13 #endif +#endif #define FONT_MEDIUM ArialMT_Plain_16 // Height: 19 #define FONT_LARGE ArialMT_Plain_24 // Height: 28 #endif diff --git a/src/graphics/fonts/OLEDDisplayFontsUA.cpp b/src/graphics/fonts/OLEDDisplayFontsUA.cpp new file mode 100644 index 000000000..ea079d57c --- /dev/null +++ b/src/graphics/fonts/OLEDDisplayFontsUA.cpp @@ -0,0 +1,424 @@ +#include "OLEDDisplayFontsUA.h" + +// Font generated or edited with the glyphEditor +const uint8_t ArialMT_Plain_10_UA[] PROGMEM = { +0x0A, // Width: 10 +0x0D, // Height: 13 +0x20, // First char: 32 +0xE0, // Number of chars: 224 +// Jump Table: +0xFF, 0xFF, 0x00, 0x0A, // 32 +0x00, 0x00, 0x04, 0x03, // 33 +0x00, 0x04, 0x05, 0x04, // 34 +0x00, 0x09, 0x09, 0x06, // 35 +0x00, 0x12, 0x0A, 0x06, // 36 +0x00, 0x1C, 0x10, 0x09, // 37 +0x00, 0x2C, 0x0E, 0x08, // 38 +0x00, 0x3A, 0x01, 0x02, // 39 +0x00, 0x3B, 0x06, 0x04, // 40 +0x00, 0x41, 0x06, 0x04, // 41 +0x00, 0x47, 0x05, 0x04, // 42 +0x00, 0x4C, 0x09, 0x06, // 43 +0x00, 0x55, 0x04, 0x03, // 44 +0x00, 0x59, 0x03, 0x03, // 45 +0x00, 0x5C, 0x04, 0x03, // 46 +0x00, 0x60, 0x05, 0x04, // 47 +0x00, 0x65, 0x0A, 0x06, // 48 +0x00, 0x6F, 0x08, 0x05, // 49 +0x00, 0x77, 0x0A, 0x06, // 50 +0x00, 0x81, 0x0A, 0x06, // 51 +0x00, 0x8B, 0x0B, 0x07, // 52 +0x00, 0x96, 0x0A, 0x06, // 53 +0x00, 0xA0, 0x0A, 0x06, // 54 +0x00, 0xAA, 0x09, 0x06, // 55 +0x00, 0xB3, 0x0A, 0x06, // 56 +0x00, 0xBD, 0x0A, 0x06, // 57 +0x00, 0xC7, 0x04, 0x03, // 58 +0x00, 0xCB, 0x04, 0x03, // 59 +0x00, 0xCF, 0x0A, 0x06, // 60 +0x00, 0xD9, 0x09, 0x06, // 61 +0x00, 0xE2, 0x09, 0x06, // 62 +0x00, 0xEB, 0x0B, 0x07, // 63 +0x00, 0xF6, 0x14, 0x0B, // 64 +0x01, 0x0A, 0x0E, 0x08, // 65 +0x01, 0x18, 0x0C, 0x07, // 66 +0x01, 0x24, 0x0C, 0x07, // 67 +0x01, 0x30, 0x0B, 0x07, // 68 +0x01, 0x3B, 0x0C, 0x07, // 69 +0x01, 0x47, 0x09, 0x06, // 70 +0x01, 0x50, 0x0D, 0x08, // 71 +0x01, 0x5D, 0x0C, 0x07, // 72 +0x01, 0x69, 0x04, 0x03, // 73 +0x01, 0x6D, 0x08, 0x05, // 74 +0x01, 0x75, 0x0E, 0x08, // 75 +0x01, 0x83, 0x0C, 0x07, // 76 +0x01, 0x8F, 0x10, 0x09, // 77 +0x01, 0x9F, 0x0C, 0x07, // 78 +0x01, 0xAB, 0x0E, 0x08, // 79 +0x01, 0xB9, 0x0B, 0x07, // 80 +0x01, 0xC4, 0x0E, 0x08, // 81 +0x01, 0xD2, 0x0C, 0x07, // 82 +0x01, 0xDE, 0x0C, 0x07, // 83 +0x01, 0xEA, 0x0B, 0x07, // 84 +0x01, 0xF5, 0x0C, 0x07, // 85 +0x02, 0x01, 0x0D, 0x08, // 86 +0x02, 0x0E, 0x11, 0x0A, // 87 +0x02, 0x1F, 0x0E, 0x08, // 88 +0x02, 0x2D, 0x0D, 0x08, // 89 +0x02, 0x3A, 0x0C, 0x07, // 90 +0x02, 0x46, 0x06, 0x04, // 91 +0x02, 0x4C, 0x06, 0x04, // 92 +0x02, 0x52, 0x04, 0x03, // 93 +0x02, 0x56, 0x09, 0x06, // 94 +0x02, 0x5F, 0x0C, 0x07, // 95 +0x02, 0x6B, 0x03, 0x03, // 96 +0x02, 0x6E, 0x0A, 0x06, // 97 +0x02, 0x78, 0x0A, 0x06, // 98 +0x02, 0x82, 0x0A, 0x06, // 99 +0x02, 0x8C, 0x0A, 0x06, // 100 +0x02, 0x96, 0x0A, 0x06, // 101 +0x02, 0xA0, 0x05, 0x04, // 102 +0x02, 0xA5, 0x0A, 0x06, // 103 +0x02, 0xAF, 0x0A, 0x06, // 104 +0x02, 0xB9, 0x04, 0x03, // 105 +0x02, 0xBD, 0x04, 0x03, // 106 +0x02, 0xC1, 0x08, 0x05, // 107 +0x02, 0xC9, 0x04, 0x03, // 108 +0x02, 0xCD, 0x10, 0x09, // 109 +0x02, 0xDD, 0x0A, 0x06, // 110 +0x02, 0xE7, 0x0A, 0x06, // 111 +0x02, 0xF1, 0x0A, 0x06, // 112 +0x02, 0xFB, 0x0A, 0x06, // 113 +0x03, 0x05, 0x05, 0x04, // 114 +0x03, 0x0A, 0x08, 0x05, // 115 +0x03, 0x12, 0x06, 0x04, // 116 +0x03, 0x18, 0x0A, 0x06, // 117 +0x03, 0x22, 0x09, 0x06, // 118 +0x03, 0x2B, 0x0E, 0x08, // 119 +0x03, 0x39, 0x0A, 0x06, // 120 +0x03, 0x43, 0x09, 0x06, // 121 +0x03, 0x4C, 0x0A, 0x06, // 122 +0x03, 0x56, 0x06, 0x04, // 123 +0x03, 0x5C, 0x04, 0x03, // 124 +0x03, 0x60, 0x05, 0x04, // 125 +0x03, 0x65, 0x09, 0x06, // 126 +0xFF, 0xFF, 0x00, 0x0A, // 127 +0xFF, 0xFF, 0x00, 0x0A, // 128 +0xFF, 0xFF, 0x00, 0x0A, // 129 +0xFF, 0xFF, 0x00, 0x0A, // 130 +0xFF, 0xFF, 0x00, 0x0A, // 131 +0xFF, 0xFF, 0x00, 0x0A, // 132 +0xFF, 0xFF, 0x00, 0x0A, // 133 +0xFF, 0xFF, 0x00, 0x0A, // 134 +0xFF, 0xFF, 0x00, 0x0A, // 135 +0xFF, 0xFF, 0x00, 0x0A, // 136 +0xFF, 0xFF, 0x00, 0x0A, // 137 +0xFF, 0xFF, 0x00, 0x0A, // 138 +0xFF, 0xFF, 0x00, 0x0A, // 139 +0xFF, 0xFF, 0x00, 0x0A, // 140 +0xFF, 0xFF, 0x00, 0x0A, // 141 +0xFF, 0xFF, 0x00, 0x0A, // 142 +0xFF, 0xFF, 0x00, 0x0A, // 143 +0xFF, 0xFF, 0x00, 0x0A, // 144 +0xFF, 0xFF, 0x00, 0x0A, // 145 +0xFF, 0xFF, 0x00, 0x0A, // 146 +0xFF, 0xFF, 0x00, 0x0A, // 147 +0xFF, 0xFF, 0x00, 0x0A, // 148 +0xFF, 0xFF, 0x00, 0x0A, // 149 +0xFF, 0xFF, 0x00, 0x0A, // 150 +0xFF, 0xFF, 0x00, 0x0A, // 151 +0xFF, 0xFF, 0x00, 0x0A, // 152 +0xFF, 0xFF, 0x00, 0x0A, // 153 +0xFF, 0xFF, 0x00, 0x0A, // 154 +0xFF, 0xFF, 0x00, 0x0A, // 155 +0xFF, 0xFF, 0x00, 0x0A, // 156 +0xFF, 0xFF, 0x00, 0x0A, // 157 +0xFF, 0xFF, 0x00, 0x0A, // 158 +0xFF, 0xFF, 0x00, 0x0A, // 159 +0xFF, 0xFF, 0x00, 0x0A, // 160 +0x03, 0x6E, 0x04, 0x03, // 161 +0x03, 0x72, 0x0A, 0x06, // 162 +0x03, 0x7C, 0x0C, 0x07, // 163 +0x03, 0x88, 0x0A, 0x06, // 164 +0x03, 0x92, 0x09, 0x06, // 165 +0x03, 0x9B, 0x04, 0x03, // 166 +0x03, 0x9F, 0x0A, 0x06, // 167 +0x03, 0xA9, 0x0C, 0x07, // 168 +0x03, 0xB5, 0x0D, 0x08, // 169 +0x03, 0xC2, 0x0C, 0x07, // 170 +0x03, 0xCE, 0x0A, 0x06, // 171 +0x03, 0xD8, 0x09, 0x06, // 172 +0x03, 0xE1, 0x03, 0x03, // 173 +0x03, 0xE4, 0x0D, 0x08, // 174 +0x03, 0xF1, 0x0C, 0x07, // 175 +0x03, 0xFD, 0x07, 0x05, // 176 +0x04, 0x04, 0x0A, 0x06, // 177 +0x04, 0x0E, 0x0C, 0x07, // 178 +0x04, 0x1A, 0x0C, 0x07, // 179 +0x04, 0x26, 0x07, 0x05, // 180 +0x04, 0x2D, 0x0A, 0x06, // 181 +0x04, 0x37, 0x09, 0x06, // 182 +0x04, 0x40, 0x03, 0x03, // 183 +0x04, 0x43, 0x0B, 0x07, // 184 +0x04, 0x4E, 0x0B, 0x07, // 185 +0x04, 0x59, 0x0C, 0x07, // 186 +0x04, 0x65, 0x0A, 0x06, // 187 +0x04, 0x6F, 0x10, 0x09, // 188 +0x04, 0x7F, 0x10, 0x09, // 189 +0x04, 0x8F, 0x10, 0x09, // 190 +0x04, 0x9F, 0x0A, 0x06, // 191 +0x04, 0xA9, 0x0C, 0x07, // 192 +0x04, 0xB5, 0x0C, 0x07, // 193 +0x04, 0xC1, 0x0C, 0x07, // 194 +0x04, 0xCD, 0x0B, 0x07, // 195 +0x04, 0xD8, 0x0C, 0x07, // 196 +0x04, 0xE4, 0x0C, 0x07, // 197 +0x04, 0xF0, 0x0C, 0x07, // 198 +0x04, 0xFC, 0x0C, 0x07, // 199 +0x05, 0x08, 0x0C, 0x07, // 200 +0x05, 0x14, 0x0C, 0x07, // 201 +0x05, 0x20, 0x0C, 0x07, // 202 +0x05, 0x2C, 0x0C, 0x07, // 203 +0x05, 0x38, 0x0C, 0x07, // 204 +0x05, 0x44, 0x0C, 0x07, // 205 +0x05, 0x50, 0x0C, 0x07, // 206 +0x05, 0x5C, 0x0C, 0x07, // 207 +0x05, 0x68, 0x0B, 0x07, // 208 +0x05, 0x73, 0x0C, 0x07, // 209 +0x05, 0x7F, 0x0B, 0x07, // 210 +0x05, 0x8A, 0x0C, 0x07, // 211 +0x05, 0x96, 0x0B, 0x07, // 212 +0x05, 0xA1, 0x0C, 0x07, // 213 +0x05, 0xAD, 0x0C, 0x07, // 214 +0x05, 0xB9, 0x0C, 0x07, // 215 +0x05, 0xC5, 0x0C, 0x07, // 216 +0x05, 0xD1, 0x0E, 0x08, // 217 +0x05, 0xDF, 0x0C, 0x07, // 218 +0x05, 0xEB, 0x0C, 0x07, // 219 +0x05, 0xF7, 0x0C, 0x07, // 220 +0x06, 0x03, 0x0C, 0x07, // 221 +0x06, 0x0F, 0x0C, 0x07, // 222 +0x06, 0x1B, 0x0C, 0x07, // 223 +0x06, 0x27, 0x0C, 0x07, // 224 +0x06, 0x33, 0x0C, 0x07, // 225 +0x06, 0x3F, 0x0C, 0x07, // 226 +0x06, 0x4B, 0x0B, 0x07, // 227 +0x06, 0x56, 0x0C, 0x07, // 228 +0x06, 0x62, 0x0B, 0x07, // 229 +0x06, 0x6D, 0x0C, 0x07, // 230 +0x06, 0x79, 0x0C, 0x07, // 231 +0x06, 0x85, 0x0C, 0x07, // 232 +0x06, 0x91, 0x0C, 0x07, // 233 +0x06, 0x9D, 0x0C, 0x07, // 234 +0x06, 0xA9, 0x0C, 0x07, // 235 +0x06, 0xB5, 0x0C, 0x07, // 236 +0x06, 0xC1, 0x0C, 0x07, // 237 +0x06, 0xCD, 0x0C, 0x07, // 238 +0x06, 0xD9, 0x0C, 0x07, // 239 +0x06, 0xE5, 0x0B, 0x07, // 240 +0x06, 0xF0, 0x0C, 0x07, // 241 +0x06, 0xFC, 0x0B, 0x07, // 242 +0x07, 0x07, 0x0C, 0x07, // 243 +0x07, 0x13, 0x0B, 0x07, // 244 +0x07, 0x1E, 0x0C, 0x07, // 245 +0x07, 0x2A, 0x0C, 0x07, // 246 +0x07, 0x36, 0x0C, 0x07, // 247 +0x07, 0x42, 0x0C, 0x07, // 248 +0x07, 0x4E, 0x0E, 0x08, // 249 +0x07, 0x5C, 0x0C, 0x07, // 250 +0x07, 0x68, 0x0C, 0x07, // 251 +0x07, 0x74, 0x0C, 0x07, // 252 +0x07, 0x80, 0x0C, 0x07, // 253 +0x07, 0x8C, 0x0C, 0x07, // 254 +0x07, 0x98, 0x0C, 0x07, // 255 +// Font Data: +0x00, 0x00, 0xF8, 0x02, // 33 +0x38, 0x00, 0x00, 0x00, 0x38, // 34 +0xA0, 0x03, 0xE0, 0x00, 0xB8, 0x03, 0xE0, 0x00, 0xB8, // 35 +0x30, 0x01, 0x28, 0x02, 0xF8, 0x07, 0x48, 0x02, 0x90, 0x01, // 36 +0x00, 0x00, 0x30, 0x00, 0x48, 0x00, 0x30, 0x03, 0xC0, 0x00, 0xB0, 0x01, 0x48, 0x02, 0x80, 0x01, // 37 +0x80, 0x01, 0x50, 0x02, 0x68, 0x02, 0xA8, 0x02, 0x18, 0x01, 0x80, 0x03, 0x80, 0x02, // 38 +0x38, // 39 +0xE0, 0x03, 0x10, 0x04, 0x08, 0x08, // 40 +0x08, 0x08, 0x10, 0x04, 0xE0, 0x03, // 41 +0x28, 0x00, 0x18, 0x00, 0x28, // 42 +0x40, 0x00, 0x40, 0x00, 0xF0, 0x01, 0x40, 0x00, 0x40, // 43 +0x00, 0x00, 0x00, 0x06, // 44 +0x80, 0x00, 0x80, // 45 +0x00, 0x00, 0x00, 0x02, // 46 +0x00, 0x03, 0xE0, 0x00, 0x18, // 47 +0xF0, 0x01, 0x08, 0x02, 0x08, 0x02, 0x08, 0x02, 0xF0, 0x01, // 48 +0x00, 0x00, 0x20, 0x00, 0x10, 0x00, 0xF8, 0x03, // 49 +0x10, 0x02, 0x08, 0x03, 0x88, 0x02, 0x48, 0x02, 0x30, 0x02, // 50 +0x10, 0x01, 0x08, 0x02, 0x48, 0x02, 0x48, 0x02, 0xB0, 0x01, // 51 +0xC0, 0x00, 0xA0, 0x00, 0x90, 0x00, 0x88, 0x00, 0xF8, 0x03, 0x80, // 52 +0x60, 0x01, 0x38, 0x02, 0x28, 0x02, 0x28, 0x02, 0xC8, 0x01, // 53 +0xF0, 0x01, 0x28, 0x02, 0x28, 0x02, 0x28, 0x02, 0xD0, 0x01, // 54 +0x08, 0x00, 0x08, 0x03, 0xC8, 0x00, 0x38, 0x00, 0x08, // 55 +0xB0, 0x01, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, 0xB0, 0x01, // 56 +0x70, 0x01, 0x88, 0x02, 0x88, 0x02, 0x88, 0x02, 0xF0, 0x01, // 57 +0x00, 0x00, 0x20, 0x02, // 58 +0x00, 0x00, 0x20, 0x06, // 59 +0x00, 0x00, 0x40, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0x10, 0x01, // 60 +0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0, // 61 +0x00, 0x00, 0x10, 0x01, 0xA0, 0x00, 0xA0, 0x00, 0x40, // 62 +0x10, 0x00, 0x08, 0x00, 0x08, 0x00, 0xC8, 0x02, 0x48, 0x00, 0x30, // 63 +0x00, 0x00, 0xC0, 0x03, 0x30, 0x04, 0xD0, 0x09, 0x28, 0x0A, 0x28, 0x0A, 0xC8, 0x0B, 0x68, 0x0A, 0x10, 0x05, 0xE0, 0x04, // 64 +0x00, 0x02, 0xC0, 0x01, 0xB0, 0x00, 0x88, 0x00, 0xB0, 0x00, 0xC0, 0x01, 0x00, 0x02, // 65 +0x00, 0x00, 0xF8, 0x03, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, 0xF0, 0x01, // 66 +0x00, 0x00, 0xF0, 0x01, 0x08, 0x02, 0x08, 0x02, 0x08, 0x02, 0x10, 0x01, // 67 +0x00, 0x00, 0xF8, 0x03, 0x08, 0x02, 0x08, 0x02, 0x10, 0x01, 0xE0, // 68 +0x00, 0x00, 0xF8, 0x03, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, // 69 +0x00, 0x00, 0xF8, 0x03, 0x48, 0x00, 0x48, 0x00, 0x08, // 70 +0x00, 0x00, 0xE0, 0x00, 0x10, 0x01, 0x08, 0x02, 0x48, 0x02, 0x50, 0x01, 0xC0, // 71 +0x00, 0x00, 0xF8, 0x03, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0xF8, 0x03, // 72 +0x00, 0x00, 0xF8, 0x03, // 73 +0x00, 0x03, 0x00, 0x02, 0x00, 0x02, 0xF8, 0x01, // 74 +0x00, 0x00, 0xF8, 0x03, 0x80, 0x00, 0x60, 0x00, 0x90, 0x00, 0x08, 0x01, 0x00, 0x02, // 75 +0x00, 0x00, 0xF8, 0x03, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, // 76 +0x00, 0x00, 0xF8, 0x03, 0x30, 0x00, 0xC0, 0x01, 0x00, 0x02, 0xC0, 0x01, 0x30, 0x00, 0xF8, 0x03, // 77 +0x00, 0x00, 0xF8, 0x03, 0x30, 0x00, 0x40, 0x00, 0x80, 0x01, 0xF8, 0x03, // 78 +0x00, 0x00, 0xF0, 0x01, 0x08, 0x02, 0x08, 0x02, 0x08, 0x02, 0x08, 0x02, 0xF0, 0x01, // 79 +0x00, 0x00, 0xF8, 0x03, 0x48, 0x00, 0x48, 0x00, 0x48, 0x00, 0x30, // 80 +0x00, 0x00, 0xF0, 0x01, 0x08, 0x02, 0x08, 0x02, 0x08, 0x03, 0x08, 0x03, 0xF0, 0x02, // 81 +0x00, 0x00, 0xF8, 0x03, 0x48, 0x00, 0x48, 0x00, 0xC8, 0x00, 0x30, 0x03, // 82 +0x00, 0x00, 0x30, 0x01, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, 0x90, 0x01, // 83 +0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0xF8, 0x03, 0x08, 0x00, 0x08, // 84 +0x00, 0x00, 0xF8, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0xF8, 0x01, // 85 +0x08, 0x00, 0x70, 0x00, 0x80, 0x01, 0x00, 0x02, 0x80, 0x01, 0x70, 0x00, 0x08, // 86 +0x18, 0x00, 0xE0, 0x01, 0x00, 0x02, 0xF0, 0x01, 0x08, 0x00, 0xF0, 0x01, 0x00, 0x02, 0xE0, 0x01, 0x18, // 87 +0x00, 0x02, 0x08, 0x01, 0x90, 0x00, 0x60, 0x00, 0x90, 0x00, 0x08, 0x01, 0x00, 0x02, // 88 +0x08, 0x00, 0x10, 0x00, 0x20, 0x00, 0xC0, 0x03, 0x20, 0x00, 0x10, 0x00, 0x08, // 89 +0x08, 0x03, 0x88, 0x02, 0xC8, 0x02, 0x68, 0x02, 0x38, 0x02, 0x18, 0x02, // 90 +0x00, 0x00, 0xF8, 0x0F, 0x08, 0x08, // 91 +0x18, 0x00, 0xE0, 0x00, 0x00, 0x03, // 92 +0x08, 0x08, 0xF8, 0x0F, // 93 +0x40, 0x00, 0x30, 0x00, 0x08, 0x00, 0x30, 0x00, 0x40, // 94 +0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, // 95 +0x08, 0x00, 0x10, // 96 +0x00, 0x00, 0x00, 0x03, 0xA0, 0x02, 0xA0, 0x02, 0xE0, 0x03, // 97 +0x00, 0x00, 0xF8, 0x03, 0x20, 0x02, 0x20, 0x02, 0xC0, 0x01, // 98 +0x00, 0x00, 0xC0, 0x01, 0x20, 0x02, 0x20, 0x02, 0x40, 0x01, // 99 +0x00, 0x00, 0xC0, 0x01, 0x20, 0x02, 0x20, 0x02, 0xF8, 0x03, // 100 +0x00, 0x00, 0xC0, 0x01, 0xA0, 0x02, 0xA0, 0x02, 0xC0, 0x02, // 101 +0x20, 0x00, 0xF0, 0x03, 0x28, // 102 +0x00, 0x00, 0xC0, 0x05, 0x20, 0x0A, 0x20, 0x0A, 0xE0, 0x07, // 103 +0x00, 0x00, 0xF8, 0x03, 0x20, 0x00, 0x20, 0x00, 0xC0, 0x03, // 104 +0x00, 0x00, 0xE8, 0x03, // 105 +0x00, 0x08, 0xE8, 0x07, // 106 +0xF8, 0x03, 0x80, 0x00, 0xC0, 0x01, 0x20, 0x02, // 107 +0x00, 0x00, 0xF8, 0x03, // 108 +0x00, 0x00, 0xE0, 0x03, 0x20, 0x00, 0x20, 0x00, 0xE0, 0x03, 0x20, 0x00, 0x20, 0x00, 0xC0, 0x03, // 109 +0x00, 0x00, 0xE0, 0x03, 0x20, 0x00, 0x20, 0x00, 0xC0, 0x03, // 110 +0x00, 0x00, 0xC0, 0x01, 0x20, 0x02, 0x20, 0x02, 0xC0, 0x01, // 111 +0x00, 0x00, 0xE0, 0x0F, 0x20, 0x02, 0x20, 0x02, 0xC0, 0x01, // 112 +0x00, 0x00, 0xC0, 0x01, 0x20, 0x02, 0x20, 0x02, 0xE0, 0x0F, // 113 +0x00, 0x00, 0xE0, 0x03, 0x20, // 114 +0x40, 0x02, 0xA0, 0x02, 0xA0, 0x02, 0x20, 0x01, // 115 +0x20, 0x00, 0xF8, 0x03, 0x20, 0x02, // 116 +0x00, 0x00, 0xE0, 0x01, 0x00, 0x02, 0x00, 0x02, 0xE0, 0x03, // 117 +0x20, 0x00, 0xC0, 0x01, 0x00, 0x02, 0xC0, 0x01, 0x20, // 118 +0xE0, 0x01, 0x00, 0x02, 0xC0, 0x01, 0x20, 0x00, 0xC0, 0x01, 0x00, 0x02, 0xE0, 0x01, // 119 +0x20, 0x02, 0x40, 0x01, 0x80, 0x00, 0x40, 0x01, 0x20, 0x02, // 120 +0x20, 0x00, 0xC0, 0x09, 0x00, 0x06, 0xC0, 0x01, 0x20, // 121 +0x20, 0x02, 0x20, 0x03, 0xA0, 0x02, 0x60, 0x02, 0x20, 0x02, // 122 +0x80, 0x00, 0x78, 0x0F, 0x08, 0x08, // 123 +0x00, 0x00, 0xF8, 0x0F, // 124 +0x08, 0x08, 0x78, 0x0F, 0x80, // 125 +0xC0, 0x00, 0x40, 0x00, 0xC0, 0x00, 0x80, 0x00, 0xC0, // 126 +0x00, 0x00, 0xA0, 0x0F, // 161 +0x00, 0x00, 0xC0, 0x01, 0xA0, 0x0F, 0x78, 0x02, 0x40, 0x01, // 162 +0x40, 0x02, 0x70, 0x03, 0xC8, 0x02, 0x48, 0x02, 0x08, 0x02, 0x10, 0x02, // 163 +0x00, 0x00, 0xE0, 0x01, 0x20, 0x01, 0x20, 0x01, 0xE0, 0x01, // 164 +0x00, 0x00, 0xF8, 0x03, 0x08, 0x00, 0x08, 0x00, 0x0C, // 165 +0x00, 0x00, 0x38, 0x0F, // 166 +0xD0, 0x04, 0x28, 0x09, 0x48, 0x09, 0x48, 0x0A, 0x90, 0x05, // 167 +0x00, 0x00, 0xE0, 0x03, 0xA8, 0x02, 0xA0, 0x02, 0xA8, 0x02, 0x20, 0x02, // 168 +0xE0, 0x00, 0x10, 0x01, 0x48, 0x02, 0xA8, 0x02, 0xA8, 0x02, 0x10, 0x01, 0xE0, // 169 +0x00, 0x00, 0xF0, 0x01, 0x58, 0x03, 0x48, 0x02, 0x08, 0x02, 0x10, 0x01, // 170 +0x00, 0x00, 0x80, 0x01, 0x40, 0x02, 0x80, 0x01, 0x40, 0x02, // 171 +0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0xE0, // 172 +0x80, 0x00, 0x80, // 173 +0xE0, 0x00, 0x10, 0x01, 0xE8, 0x02, 0x68, 0x02, 0xC8, 0x02, 0x10, 0x01, 0xE0, // 174 +0x00, 0x00, 0x08, 0x02, 0x0A, 0x02, 0xF8, 0x03, 0x0A, 0x02, 0x08, 0x02, // 175 +0x00, 0x00, 0x38, 0x00, 0x28, 0x00, 0x38, // 176 +0x40, 0x02, 0x40, 0x02, 0xF0, 0x03, 0x40, 0x02, 0x40, 0x02, // 177 +0x00, 0x00, 0x08, 0x02, 0x08, 0x02, 0xF8, 0x03, 0x08, 0x02, 0x08, 0x02, // 178 +0x00, 0x00, 0x20, 0x02, 0x20, 0x02, 0xE8, 0x03, 0x20, 0x02, 0x20, 0x02, // 179 +0x00, 0x00, 0xE0, 0x03, 0x20, 0x00, 0x30, // 180 +0x00, 0x00, 0xE0, 0x0F, 0x00, 0x02, 0x00, 0x02, 0xE0, 0x03, // 181 +0x70, 0x00, 0xF8, 0x0F, 0x08, 0x00, 0xF8, 0x0F, 0x08, // 182 +0x00, 0x00, 0x40, // 183 +0x00, 0x00, 0xC0, 0x01, 0xA8, 0x02, 0xA0, 0x02, 0xA8, 0x02, 0xC0, // 184 +0x00, 0x00, 0xF0, 0x03, 0x40, 0x00, 0x80, 0x00, 0xF8, 0x03, 0x08, // 185 +0x00, 0x00, 0xE0, 0x01, 0x50, 0x02, 0x50, 0x02, 0x10, 0x02, 0x20, 0x01, // 186 +0x00, 0x00, 0x40, 0x02, 0x80, 0x01, 0x40, 0x02, 0x80, 0x01, // 187 +0x00, 0x00, 0x10, 0x02, 0x78, 0x01, 0xC0, 0x00, 0x20, 0x01, 0x90, 0x01, 0xC8, 0x03, 0x00, 0x01, // 188 +0x00, 0x00, 0x10, 0x02, 0x78, 0x01, 0x80, 0x00, 0x60, 0x00, 0x50, 0x02, 0x48, 0x03, 0xC0, 0x02, // 189 +0x48, 0x00, 0x58, 0x00, 0x68, 0x03, 0x80, 0x00, 0x60, 0x01, 0x90, 0x01, 0xC8, 0x03, 0x00, 0x01, // 190 +0x00, 0x00, 0x00, 0x00, 0x28, 0x02, 0xE0, 0x03, 0x28, 0x02, // 191 +0x00, 0x00, 0xF0, 0x03, 0x88, 0x00, 0x88, 0x00, 0x88, 0x00, 0xF0, 0x03, // 192 +0x00, 0x00, 0xF8, 0x03, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, 0x88, 0x01, // 193 +0x00, 0x00, 0xF8, 0x03, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, 0xB0, 0x01, // 194 +0x00, 0x00, 0xF8, 0x03, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x18, // 195 +0x00, 0x00, 0x00, 0x02, 0xFC, 0x03, 0x04, 0x02, 0xFC, 0x03, 0x00, 0x02, // 196 +0x00, 0x00, 0xF8, 0x03, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, 0x08, 0x02, // 197 +0x00, 0x00, 0xB8, 0x03, 0x40, 0x00, 0xF8, 0x03, 0x40, 0x00, 0xB8, 0x03, // 198 +0x00, 0x00, 0x08, 0x02, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, 0xB0, 0x01, // 199 +0x00, 0x00, 0xF8, 0x03, 0x80, 0x00, 0x40, 0x00, 0x20, 0x00, 0xF8, 0x03, // 200 +0x00, 0x00, 0xE0, 0x03, 0x08, 0x01, 0x90, 0x00, 0x48, 0x00, 0xE0, 0x03, // 201 +0x00, 0x00, 0xF8, 0x03, 0x40, 0x00, 0xA0, 0x00, 0x10, 0x01, 0x08, 0x02, // 202 +0x00, 0x00, 0x00, 0x02, 0xF0, 0x01, 0x08, 0x00, 0x08, 0x00, 0xF8, 0x03, // 203 +0x00, 0x00, 0xF8, 0x03, 0x10, 0x00, 0x60, 0x00, 0x10, 0x00, 0xF8, 0x03, // 204 +0x00, 0x00, 0xF8, 0x03, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0xF8, 0x03, // 205 +0x00, 0x00, 0xF0, 0x01, 0x08, 0x02, 0x08, 0x02, 0x08, 0x02, 0xF0, 0x01, // 206 +0x00, 0x00, 0xF8, 0x03, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0xF8, 0x03, // 207 +0x00, 0x00, 0xF8, 0x03, 0x48, 0x00, 0x48, 0x00, 0x48, 0x00, 0x30, // 208 +0x00, 0x00, 0xF0, 0x01, 0x08, 0x02, 0x08, 0x02, 0x08, 0x02, 0x10, 0x01, // 209 +0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0xF8, 0x03, 0x08, 0x00, 0x08, // 210 +0x00, 0x00, 0x38, 0x00, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0xF8, 0x01, // 211 +0x00, 0x00, 0x70, 0x00, 0x88, 0x00, 0xF8, 0x03, 0x88, 0x00, 0x70, // 212 +0x00, 0x00, 0x18, 0x03, 0xA0, 0x00, 0x40, 0x00, 0xA0, 0x00, 0x18, 0x03, // 213 +0x00, 0x00, 0xF8, 0x03, 0x00, 0x02, 0x00, 0x02, 0xF8, 0x03, 0x00, 0x02, // 214 +0x00, 0x00, 0x38, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0xF8, 0x03, // 215 +0x00, 0x00, 0xF8, 0x03, 0x00, 0x02, 0xF8, 0x03, 0x00, 0x02, 0xF8, 0x03, // 216 +0x00, 0x00, 0xF8, 0x03, 0x00, 0x02, 0xF8, 0x03, 0x00, 0x02, 0xF8, 0x03, 0x00, 0x06, // 217 +0x00, 0x00, 0x08, 0x00, 0xF8, 0x03, 0x40, 0x02, 0x40, 0x02, 0x80, 0x01, // 218 +0x00, 0x00, 0xF8, 0x03, 0x40, 0x02, 0x40, 0x02, 0x80, 0x01, 0xF8, 0x03, // 219 +0x00, 0x00, 0xF8, 0x03, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x80, 0x01, // 220 +0x00, 0x00, 0x10, 0x01, 0x08, 0x02, 0x48, 0x02, 0x48, 0x02, 0xF0, 0x01, // 221 +0x00, 0x00, 0xF8, 0x03, 0x40, 0x00, 0xF0, 0x01, 0x08, 0x02, 0xF0, 0x01, // 222 +0x00, 0x00, 0x30, 0x02, 0x48, 0x01, 0xC8, 0x00, 0x48, 0x00, 0xF8, 0x03, // 223 +0x00, 0x00, 0x00, 0x01, 0xA0, 0x02, 0xA0, 0x02, 0xA0, 0x02, 0xC0, 0x03, // 224 +0x00, 0x00, 0xE0, 0x01, 0x50, 0x02, 0x50, 0x02, 0x48, 0x02, 0x88, 0x01, // 225 +0x00, 0x00, 0xE0, 0x03, 0xA0, 0x02, 0xA0, 0x02, 0xA0, 0x02, 0x40, 0x01, // 226 +0x00, 0x00, 0xE0, 0x03, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x60, // 227 +0x00, 0x00, 0x00, 0x02, 0xC0, 0x03, 0x20, 0x02, 0xE0, 0x03, 0x00, 0x02, // 228 +0x00, 0x00, 0xC0, 0x01, 0xA0, 0x02, 0xA0, 0x02, 0xA0, 0x02, 0xC0, // 229 +0x00, 0x00, 0x60, 0x03, 0x80, 0x00, 0xE0, 0x03, 0x80, 0x00, 0x60, 0x03, // 230 +0x00, 0x00, 0x20, 0x02, 0xA0, 0x02, 0xA0, 0x02, 0xA0, 0x02, 0x40, 0x01, // 231 +0x00, 0x00, 0xE0, 0x03, 0x00, 0x01, 0x80, 0x00, 0x40, 0x00, 0xE0, 0x03, // 232 +0x00, 0x00, 0xE0, 0x03, 0x00, 0x01, 0x98, 0x00, 0x40, 0x00, 0xE0, 0x03, // 233 +0x00, 0x00, 0xE0, 0x03, 0x80, 0x00, 0x80, 0x00, 0x40, 0x01, 0x20, 0x02, // 234 +0x00, 0x00, 0x00, 0x02, 0xC0, 0x01, 0x20, 0x00, 0x20, 0x00, 0xE0, 0x03, // 235 +0x00, 0x00, 0xE0, 0x03, 0x40, 0x00, 0x80, 0x00, 0x40, 0x00, 0xE0, 0x03, // 236 +0x00, 0x00, 0xE0, 0x03, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0xE0, 0x03, // 237 +0x00, 0x00, 0xC0, 0x01, 0x20, 0x02, 0x20, 0x02, 0x20, 0x02, 0xC0, 0x01, // 238 +0x00, 0x00, 0xE0, 0x03, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0xE0, 0x03, // 239 +0x00, 0x00, 0xE0, 0x03, 0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0x40, // 240 +0x00, 0x00, 0xC0, 0x01, 0x20, 0x02, 0x20, 0x02, 0x20, 0x02, 0x40, 0x02, // 241 +0x00, 0x00, 0x20, 0x00, 0x20, 0x00, 0xE0, 0x03, 0x20, 0x00, 0x20, // 242 +0x00, 0x00, 0x60, 0x00, 0x80, 0x02, 0x80, 0x02, 0x80, 0x02, 0xE0, 0x01, // 243 +0x00, 0x00, 0xC0, 0x00, 0x20, 0x01, 0xE0, 0x03, 0x20, 0x01, 0xC0, // 244 +0x00, 0x00, 0x20, 0x02, 0x40, 0x01, 0x80, 0x00, 0x40, 0x01, 0x20, 0x02, // 245 +0x00, 0x00, 0xE0, 0x03, 0x00, 0x02, 0x00, 0x02, 0xE0, 0x03, 0x00, 0x02, // 246 +0x00, 0x00, 0x60, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0xE0, 0x03, // 247 +0x00, 0x00, 0xE0, 0x03, 0x00, 0x02, 0xE0, 0x03, 0x00, 0x02, 0xE0, 0x03, // 248 +0x00, 0x00, 0xE0, 0x03, 0x00, 0x02, 0xE0, 0x03, 0x00, 0x02, 0xE0, 0x03, 0x00, 0x06, // 249 +0x00, 0x00, 0x20, 0x00, 0xE0, 0x03, 0x80, 0x02, 0x80, 0x02, 0x00, 0x01, // 250 +0x00, 0x00, 0xE0, 0x03, 0x80, 0x02, 0x80, 0x02, 0x00, 0x01, 0xE0, 0x03, // 251 +0x00, 0x00, 0xE0, 0x03, 0x80, 0x02, 0x80, 0x02, 0x80, 0x02, 0x00, 0x01, // 252 +0x00, 0x00, 0x40, 0x01, 0x20, 0x02, 0xA0, 0x02, 0xA0, 0x02, 0xC0, 0x01, // 253 +0x00, 0x00, 0xE0, 0x03, 0x80, 0x00, 0xC0, 0x01, 0x20, 0x02, 0xC0, 0x01, // 254 +0x00, 0x00, 0x40, 0x02, 0xA0, 0x01, 0xA0, 0x00, 0xA0, 0x00, 0xE0, 0x03, // 255 +}; \ No newline at end of file diff --git a/src/graphics/fonts/OLEDDisplayFontsUA.h b/src/graphics/fonts/OLEDDisplayFontsUA.h new file mode 100644 index 000000000..3bd9bb4ca --- /dev/null +++ b/src/graphics/fonts/OLEDDisplayFontsUA.h @@ -0,0 +1,11 @@ +#ifndef OLEDDISPLAYFONTSUA_h +#define OLEDDISPLAYFONTSUA_h + +#ifdef ARDUINO +#include +#elif __MBED__ +#define PROGMEM +#endif + +extern const uint8_t ArialMT_Plain_10_UA[] PROGMEM; +#endif \ No newline at end of file From ce882b389a941b973f1ef8e0a926fa3ab69255c8 Mon Sep 17 00:00:00 2001 From: Krezalis Date: Mon, 20 Feb 2023 18:03:32 +0200 Subject: [PATCH 15/56] Update Screen.h (#2285) Co-authored-by: Ben Meadors --- src/graphics/Screen.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/graphics/Screen.h b/src/graphics/Screen.h index 5e92e73bb..ff55472e8 100644 --- a/src/graphics/Screen.h +++ b/src/graphics/Screen.h @@ -240,6 +240,9 @@ class Screen : public concurrency::OSThread // library have empty chars for non-latin ASCII symbols case 0xD0: { SKIPREST = false; + if (ch == 132) return (uint8_t)(170); // Є + if (ch == 134) return (uint8_t)(178); // І + if (ch == 135) return (uint8_t)(175); // Ї if (ch == 129) return (uint8_t)(168); // Ё if (ch > 143 && ch < 192) @@ -248,12 +251,21 @@ class Screen : public concurrency::OSThread } case 0xD1: { SKIPREST = false; + if (ch == 148) return (uint8_t)(186); // є + if (ch == 150) return (uint8_t)(179); // і + if (ch == 151) return (uint8_t)(191); // ї if (ch == 145) return (uint8_t)(184); // ё if (ch > 127 && ch < 144) return (uint8_t)(ch + 112); break; } + case 0xD2: { + SKIPREST = false; + if (ch == 144) return (uint8_t)(165); // Ґ + if (ch == 145) return (uint8_t)(180); // ґ + break; + } } // We want to strip out prefix chars for two-byte char formats From 548bec026a2a324c951413ebafb89449f6f893ff Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Mon, 20 Feb 2023 10:05:11 -0600 Subject: [PATCH 16/56] Trunk fmt --- src/graphics/Screen.h | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/graphics/Screen.h b/src/graphics/Screen.h index ff55472e8..51f3a2fe6 100644 --- a/src/graphics/Screen.h +++ b/src/graphics/Screen.h @@ -240,9 +240,12 @@ class Screen : public concurrency::OSThread // library have empty chars for non-latin ASCII symbols case 0xD0: { SKIPREST = false; - if (ch == 132) return (uint8_t)(170); // Є - if (ch == 134) return (uint8_t)(178); // І - if (ch == 135) return (uint8_t)(175); // Ї + if (ch == 132) + return (uint8_t)(170); // Є + if (ch == 134) + return (uint8_t)(178); // І + if (ch == 135) + return (uint8_t)(175); // Ї if (ch == 129) return (uint8_t)(168); // Ё if (ch > 143 && ch < 192) @@ -251,9 +254,12 @@ class Screen : public concurrency::OSThread } case 0xD1: { SKIPREST = false; - if (ch == 148) return (uint8_t)(186); // є - if (ch == 150) return (uint8_t)(179); // і - if (ch == 151) return (uint8_t)(191); // ї + if (ch == 148) + return (uint8_t)(186); // є + if (ch == 150) + return (uint8_t)(179); // і + if (ch == 151) + return (uint8_t)(191); // ї if (ch == 145) return (uint8_t)(184); // ё if (ch > 127 && ch < 144) @@ -262,8 +268,10 @@ class Screen : public concurrency::OSThread } case 0xD2: { SKIPREST = false; - if (ch == 144) return (uint8_t)(165); // Ґ - if (ch == 145) return (uint8_t)(180); // ґ + if (ch == 144) + return (uint8_t)(165); // Ґ + if (ch == 145) + return (uint8_t)(180); // ґ break; } } From a92b2ec6cab5542fbb03c26392a523e4fe62c5fd Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Mon, 20 Feb 2023 12:33:01 -0600 Subject: [PATCH 17/56] Trunk fix --- src/graphics/fonts/OLEDDisplayFontsUA.cpp | 838 +++++++++++----------- 1 file changed, 419 insertions(+), 419 deletions(-) diff --git a/src/graphics/fonts/OLEDDisplayFontsUA.cpp b/src/graphics/fonts/OLEDDisplayFontsUA.cpp index ea079d57c..0295ee6ba 100644 --- a/src/graphics/fonts/OLEDDisplayFontsUA.cpp +++ b/src/graphics/fonts/OLEDDisplayFontsUA.cpp @@ -2,423 +2,423 @@ // Font generated or edited with the glyphEditor const uint8_t ArialMT_Plain_10_UA[] PROGMEM = { -0x0A, // Width: 10 -0x0D, // Height: 13 -0x20, // First char: 32 -0xE0, // Number of chars: 224 -// Jump Table: -0xFF, 0xFF, 0x00, 0x0A, // 32 -0x00, 0x00, 0x04, 0x03, // 33 -0x00, 0x04, 0x05, 0x04, // 34 -0x00, 0x09, 0x09, 0x06, // 35 -0x00, 0x12, 0x0A, 0x06, // 36 -0x00, 0x1C, 0x10, 0x09, // 37 -0x00, 0x2C, 0x0E, 0x08, // 38 -0x00, 0x3A, 0x01, 0x02, // 39 -0x00, 0x3B, 0x06, 0x04, // 40 -0x00, 0x41, 0x06, 0x04, // 41 -0x00, 0x47, 0x05, 0x04, // 42 -0x00, 0x4C, 0x09, 0x06, // 43 -0x00, 0x55, 0x04, 0x03, // 44 -0x00, 0x59, 0x03, 0x03, // 45 -0x00, 0x5C, 0x04, 0x03, // 46 -0x00, 0x60, 0x05, 0x04, // 47 -0x00, 0x65, 0x0A, 0x06, // 48 -0x00, 0x6F, 0x08, 0x05, // 49 -0x00, 0x77, 0x0A, 0x06, // 50 -0x00, 0x81, 0x0A, 0x06, // 51 -0x00, 0x8B, 0x0B, 0x07, // 52 -0x00, 0x96, 0x0A, 0x06, // 53 -0x00, 0xA0, 0x0A, 0x06, // 54 -0x00, 0xAA, 0x09, 0x06, // 55 -0x00, 0xB3, 0x0A, 0x06, // 56 -0x00, 0xBD, 0x0A, 0x06, // 57 -0x00, 0xC7, 0x04, 0x03, // 58 -0x00, 0xCB, 0x04, 0x03, // 59 -0x00, 0xCF, 0x0A, 0x06, // 60 -0x00, 0xD9, 0x09, 0x06, // 61 -0x00, 0xE2, 0x09, 0x06, // 62 -0x00, 0xEB, 0x0B, 0x07, // 63 -0x00, 0xF6, 0x14, 0x0B, // 64 -0x01, 0x0A, 0x0E, 0x08, // 65 -0x01, 0x18, 0x0C, 0x07, // 66 -0x01, 0x24, 0x0C, 0x07, // 67 -0x01, 0x30, 0x0B, 0x07, // 68 -0x01, 0x3B, 0x0C, 0x07, // 69 -0x01, 0x47, 0x09, 0x06, // 70 -0x01, 0x50, 0x0D, 0x08, // 71 -0x01, 0x5D, 0x0C, 0x07, // 72 -0x01, 0x69, 0x04, 0x03, // 73 -0x01, 0x6D, 0x08, 0x05, // 74 -0x01, 0x75, 0x0E, 0x08, // 75 -0x01, 0x83, 0x0C, 0x07, // 76 -0x01, 0x8F, 0x10, 0x09, // 77 -0x01, 0x9F, 0x0C, 0x07, // 78 -0x01, 0xAB, 0x0E, 0x08, // 79 -0x01, 0xB9, 0x0B, 0x07, // 80 -0x01, 0xC4, 0x0E, 0x08, // 81 -0x01, 0xD2, 0x0C, 0x07, // 82 -0x01, 0xDE, 0x0C, 0x07, // 83 -0x01, 0xEA, 0x0B, 0x07, // 84 -0x01, 0xF5, 0x0C, 0x07, // 85 -0x02, 0x01, 0x0D, 0x08, // 86 -0x02, 0x0E, 0x11, 0x0A, // 87 -0x02, 0x1F, 0x0E, 0x08, // 88 -0x02, 0x2D, 0x0D, 0x08, // 89 -0x02, 0x3A, 0x0C, 0x07, // 90 -0x02, 0x46, 0x06, 0x04, // 91 -0x02, 0x4C, 0x06, 0x04, // 92 -0x02, 0x52, 0x04, 0x03, // 93 -0x02, 0x56, 0x09, 0x06, // 94 -0x02, 0x5F, 0x0C, 0x07, // 95 -0x02, 0x6B, 0x03, 0x03, // 96 -0x02, 0x6E, 0x0A, 0x06, // 97 -0x02, 0x78, 0x0A, 0x06, // 98 -0x02, 0x82, 0x0A, 0x06, // 99 -0x02, 0x8C, 0x0A, 0x06, // 100 -0x02, 0x96, 0x0A, 0x06, // 101 -0x02, 0xA0, 0x05, 0x04, // 102 -0x02, 0xA5, 0x0A, 0x06, // 103 -0x02, 0xAF, 0x0A, 0x06, // 104 -0x02, 0xB9, 0x04, 0x03, // 105 -0x02, 0xBD, 0x04, 0x03, // 106 -0x02, 0xC1, 0x08, 0x05, // 107 -0x02, 0xC9, 0x04, 0x03, // 108 -0x02, 0xCD, 0x10, 0x09, // 109 -0x02, 0xDD, 0x0A, 0x06, // 110 -0x02, 0xE7, 0x0A, 0x06, // 111 -0x02, 0xF1, 0x0A, 0x06, // 112 -0x02, 0xFB, 0x0A, 0x06, // 113 -0x03, 0x05, 0x05, 0x04, // 114 -0x03, 0x0A, 0x08, 0x05, // 115 -0x03, 0x12, 0x06, 0x04, // 116 -0x03, 0x18, 0x0A, 0x06, // 117 -0x03, 0x22, 0x09, 0x06, // 118 -0x03, 0x2B, 0x0E, 0x08, // 119 -0x03, 0x39, 0x0A, 0x06, // 120 -0x03, 0x43, 0x09, 0x06, // 121 -0x03, 0x4C, 0x0A, 0x06, // 122 -0x03, 0x56, 0x06, 0x04, // 123 -0x03, 0x5C, 0x04, 0x03, // 124 -0x03, 0x60, 0x05, 0x04, // 125 -0x03, 0x65, 0x09, 0x06, // 126 -0xFF, 0xFF, 0x00, 0x0A, // 127 -0xFF, 0xFF, 0x00, 0x0A, // 128 -0xFF, 0xFF, 0x00, 0x0A, // 129 -0xFF, 0xFF, 0x00, 0x0A, // 130 -0xFF, 0xFF, 0x00, 0x0A, // 131 -0xFF, 0xFF, 0x00, 0x0A, // 132 -0xFF, 0xFF, 0x00, 0x0A, // 133 -0xFF, 0xFF, 0x00, 0x0A, // 134 -0xFF, 0xFF, 0x00, 0x0A, // 135 -0xFF, 0xFF, 0x00, 0x0A, // 136 -0xFF, 0xFF, 0x00, 0x0A, // 137 -0xFF, 0xFF, 0x00, 0x0A, // 138 -0xFF, 0xFF, 0x00, 0x0A, // 139 -0xFF, 0xFF, 0x00, 0x0A, // 140 -0xFF, 0xFF, 0x00, 0x0A, // 141 -0xFF, 0xFF, 0x00, 0x0A, // 142 -0xFF, 0xFF, 0x00, 0x0A, // 143 -0xFF, 0xFF, 0x00, 0x0A, // 144 -0xFF, 0xFF, 0x00, 0x0A, // 145 -0xFF, 0xFF, 0x00, 0x0A, // 146 -0xFF, 0xFF, 0x00, 0x0A, // 147 -0xFF, 0xFF, 0x00, 0x0A, // 148 -0xFF, 0xFF, 0x00, 0x0A, // 149 -0xFF, 0xFF, 0x00, 0x0A, // 150 -0xFF, 0xFF, 0x00, 0x0A, // 151 -0xFF, 0xFF, 0x00, 0x0A, // 152 -0xFF, 0xFF, 0x00, 0x0A, // 153 -0xFF, 0xFF, 0x00, 0x0A, // 154 -0xFF, 0xFF, 0x00, 0x0A, // 155 -0xFF, 0xFF, 0x00, 0x0A, // 156 -0xFF, 0xFF, 0x00, 0x0A, // 157 -0xFF, 0xFF, 0x00, 0x0A, // 158 -0xFF, 0xFF, 0x00, 0x0A, // 159 -0xFF, 0xFF, 0x00, 0x0A, // 160 -0x03, 0x6E, 0x04, 0x03, // 161 -0x03, 0x72, 0x0A, 0x06, // 162 -0x03, 0x7C, 0x0C, 0x07, // 163 -0x03, 0x88, 0x0A, 0x06, // 164 -0x03, 0x92, 0x09, 0x06, // 165 -0x03, 0x9B, 0x04, 0x03, // 166 -0x03, 0x9F, 0x0A, 0x06, // 167 -0x03, 0xA9, 0x0C, 0x07, // 168 -0x03, 0xB5, 0x0D, 0x08, // 169 -0x03, 0xC2, 0x0C, 0x07, // 170 -0x03, 0xCE, 0x0A, 0x06, // 171 -0x03, 0xD8, 0x09, 0x06, // 172 -0x03, 0xE1, 0x03, 0x03, // 173 -0x03, 0xE4, 0x0D, 0x08, // 174 -0x03, 0xF1, 0x0C, 0x07, // 175 -0x03, 0xFD, 0x07, 0x05, // 176 -0x04, 0x04, 0x0A, 0x06, // 177 -0x04, 0x0E, 0x0C, 0x07, // 178 -0x04, 0x1A, 0x0C, 0x07, // 179 -0x04, 0x26, 0x07, 0x05, // 180 -0x04, 0x2D, 0x0A, 0x06, // 181 -0x04, 0x37, 0x09, 0x06, // 182 -0x04, 0x40, 0x03, 0x03, // 183 -0x04, 0x43, 0x0B, 0x07, // 184 -0x04, 0x4E, 0x0B, 0x07, // 185 -0x04, 0x59, 0x0C, 0x07, // 186 -0x04, 0x65, 0x0A, 0x06, // 187 -0x04, 0x6F, 0x10, 0x09, // 188 -0x04, 0x7F, 0x10, 0x09, // 189 -0x04, 0x8F, 0x10, 0x09, // 190 -0x04, 0x9F, 0x0A, 0x06, // 191 -0x04, 0xA9, 0x0C, 0x07, // 192 -0x04, 0xB5, 0x0C, 0x07, // 193 -0x04, 0xC1, 0x0C, 0x07, // 194 -0x04, 0xCD, 0x0B, 0x07, // 195 -0x04, 0xD8, 0x0C, 0x07, // 196 -0x04, 0xE4, 0x0C, 0x07, // 197 -0x04, 0xF0, 0x0C, 0x07, // 198 -0x04, 0xFC, 0x0C, 0x07, // 199 -0x05, 0x08, 0x0C, 0x07, // 200 -0x05, 0x14, 0x0C, 0x07, // 201 -0x05, 0x20, 0x0C, 0x07, // 202 -0x05, 0x2C, 0x0C, 0x07, // 203 -0x05, 0x38, 0x0C, 0x07, // 204 -0x05, 0x44, 0x0C, 0x07, // 205 -0x05, 0x50, 0x0C, 0x07, // 206 -0x05, 0x5C, 0x0C, 0x07, // 207 -0x05, 0x68, 0x0B, 0x07, // 208 -0x05, 0x73, 0x0C, 0x07, // 209 -0x05, 0x7F, 0x0B, 0x07, // 210 -0x05, 0x8A, 0x0C, 0x07, // 211 -0x05, 0x96, 0x0B, 0x07, // 212 -0x05, 0xA1, 0x0C, 0x07, // 213 -0x05, 0xAD, 0x0C, 0x07, // 214 -0x05, 0xB9, 0x0C, 0x07, // 215 -0x05, 0xC5, 0x0C, 0x07, // 216 -0x05, 0xD1, 0x0E, 0x08, // 217 -0x05, 0xDF, 0x0C, 0x07, // 218 -0x05, 0xEB, 0x0C, 0x07, // 219 -0x05, 0xF7, 0x0C, 0x07, // 220 -0x06, 0x03, 0x0C, 0x07, // 221 -0x06, 0x0F, 0x0C, 0x07, // 222 -0x06, 0x1B, 0x0C, 0x07, // 223 -0x06, 0x27, 0x0C, 0x07, // 224 -0x06, 0x33, 0x0C, 0x07, // 225 -0x06, 0x3F, 0x0C, 0x07, // 226 -0x06, 0x4B, 0x0B, 0x07, // 227 -0x06, 0x56, 0x0C, 0x07, // 228 -0x06, 0x62, 0x0B, 0x07, // 229 -0x06, 0x6D, 0x0C, 0x07, // 230 -0x06, 0x79, 0x0C, 0x07, // 231 -0x06, 0x85, 0x0C, 0x07, // 232 -0x06, 0x91, 0x0C, 0x07, // 233 -0x06, 0x9D, 0x0C, 0x07, // 234 -0x06, 0xA9, 0x0C, 0x07, // 235 -0x06, 0xB5, 0x0C, 0x07, // 236 -0x06, 0xC1, 0x0C, 0x07, // 237 -0x06, 0xCD, 0x0C, 0x07, // 238 -0x06, 0xD9, 0x0C, 0x07, // 239 -0x06, 0xE5, 0x0B, 0x07, // 240 -0x06, 0xF0, 0x0C, 0x07, // 241 -0x06, 0xFC, 0x0B, 0x07, // 242 -0x07, 0x07, 0x0C, 0x07, // 243 -0x07, 0x13, 0x0B, 0x07, // 244 -0x07, 0x1E, 0x0C, 0x07, // 245 -0x07, 0x2A, 0x0C, 0x07, // 246 -0x07, 0x36, 0x0C, 0x07, // 247 -0x07, 0x42, 0x0C, 0x07, // 248 -0x07, 0x4E, 0x0E, 0x08, // 249 -0x07, 0x5C, 0x0C, 0x07, // 250 -0x07, 0x68, 0x0C, 0x07, // 251 -0x07, 0x74, 0x0C, 0x07, // 252 -0x07, 0x80, 0x0C, 0x07, // 253 -0x07, 0x8C, 0x0C, 0x07, // 254 -0x07, 0x98, 0x0C, 0x07, // 255 -// Font Data: -0x00, 0x00, 0xF8, 0x02, // 33 -0x38, 0x00, 0x00, 0x00, 0x38, // 34 -0xA0, 0x03, 0xE0, 0x00, 0xB8, 0x03, 0xE0, 0x00, 0xB8, // 35 -0x30, 0x01, 0x28, 0x02, 0xF8, 0x07, 0x48, 0x02, 0x90, 0x01, // 36 -0x00, 0x00, 0x30, 0x00, 0x48, 0x00, 0x30, 0x03, 0xC0, 0x00, 0xB0, 0x01, 0x48, 0x02, 0x80, 0x01, // 37 -0x80, 0x01, 0x50, 0x02, 0x68, 0x02, 0xA8, 0x02, 0x18, 0x01, 0x80, 0x03, 0x80, 0x02, // 38 -0x38, // 39 -0xE0, 0x03, 0x10, 0x04, 0x08, 0x08, // 40 -0x08, 0x08, 0x10, 0x04, 0xE0, 0x03, // 41 -0x28, 0x00, 0x18, 0x00, 0x28, // 42 -0x40, 0x00, 0x40, 0x00, 0xF0, 0x01, 0x40, 0x00, 0x40, // 43 -0x00, 0x00, 0x00, 0x06, // 44 -0x80, 0x00, 0x80, // 45 -0x00, 0x00, 0x00, 0x02, // 46 -0x00, 0x03, 0xE0, 0x00, 0x18, // 47 -0xF0, 0x01, 0x08, 0x02, 0x08, 0x02, 0x08, 0x02, 0xF0, 0x01, // 48 -0x00, 0x00, 0x20, 0x00, 0x10, 0x00, 0xF8, 0x03, // 49 -0x10, 0x02, 0x08, 0x03, 0x88, 0x02, 0x48, 0x02, 0x30, 0x02, // 50 -0x10, 0x01, 0x08, 0x02, 0x48, 0x02, 0x48, 0x02, 0xB0, 0x01, // 51 -0xC0, 0x00, 0xA0, 0x00, 0x90, 0x00, 0x88, 0x00, 0xF8, 0x03, 0x80, // 52 -0x60, 0x01, 0x38, 0x02, 0x28, 0x02, 0x28, 0x02, 0xC8, 0x01, // 53 -0xF0, 0x01, 0x28, 0x02, 0x28, 0x02, 0x28, 0x02, 0xD0, 0x01, // 54 -0x08, 0x00, 0x08, 0x03, 0xC8, 0x00, 0x38, 0x00, 0x08, // 55 -0xB0, 0x01, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, 0xB0, 0x01, // 56 -0x70, 0x01, 0x88, 0x02, 0x88, 0x02, 0x88, 0x02, 0xF0, 0x01, // 57 -0x00, 0x00, 0x20, 0x02, // 58 -0x00, 0x00, 0x20, 0x06, // 59 -0x00, 0x00, 0x40, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0x10, 0x01, // 60 -0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0, // 61 -0x00, 0x00, 0x10, 0x01, 0xA0, 0x00, 0xA0, 0x00, 0x40, // 62 -0x10, 0x00, 0x08, 0x00, 0x08, 0x00, 0xC8, 0x02, 0x48, 0x00, 0x30, // 63 -0x00, 0x00, 0xC0, 0x03, 0x30, 0x04, 0xD0, 0x09, 0x28, 0x0A, 0x28, 0x0A, 0xC8, 0x0B, 0x68, 0x0A, 0x10, 0x05, 0xE0, 0x04, // 64 -0x00, 0x02, 0xC0, 0x01, 0xB0, 0x00, 0x88, 0x00, 0xB0, 0x00, 0xC0, 0x01, 0x00, 0x02, // 65 -0x00, 0x00, 0xF8, 0x03, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, 0xF0, 0x01, // 66 -0x00, 0x00, 0xF0, 0x01, 0x08, 0x02, 0x08, 0x02, 0x08, 0x02, 0x10, 0x01, // 67 -0x00, 0x00, 0xF8, 0x03, 0x08, 0x02, 0x08, 0x02, 0x10, 0x01, 0xE0, // 68 -0x00, 0x00, 0xF8, 0x03, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, // 69 -0x00, 0x00, 0xF8, 0x03, 0x48, 0x00, 0x48, 0x00, 0x08, // 70 -0x00, 0x00, 0xE0, 0x00, 0x10, 0x01, 0x08, 0x02, 0x48, 0x02, 0x50, 0x01, 0xC0, // 71 -0x00, 0x00, 0xF8, 0x03, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0xF8, 0x03, // 72 -0x00, 0x00, 0xF8, 0x03, // 73 -0x00, 0x03, 0x00, 0x02, 0x00, 0x02, 0xF8, 0x01, // 74 -0x00, 0x00, 0xF8, 0x03, 0x80, 0x00, 0x60, 0x00, 0x90, 0x00, 0x08, 0x01, 0x00, 0x02, // 75 -0x00, 0x00, 0xF8, 0x03, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, // 76 -0x00, 0x00, 0xF8, 0x03, 0x30, 0x00, 0xC0, 0x01, 0x00, 0x02, 0xC0, 0x01, 0x30, 0x00, 0xF8, 0x03, // 77 -0x00, 0x00, 0xF8, 0x03, 0x30, 0x00, 0x40, 0x00, 0x80, 0x01, 0xF8, 0x03, // 78 -0x00, 0x00, 0xF0, 0x01, 0x08, 0x02, 0x08, 0x02, 0x08, 0x02, 0x08, 0x02, 0xF0, 0x01, // 79 -0x00, 0x00, 0xF8, 0x03, 0x48, 0x00, 0x48, 0x00, 0x48, 0x00, 0x30, // 80 -0x00, 0x00, 0xF0, 0x01, 0x08, 0x02, 0x08, 0x02, 0x08, 0x03, 0x08, 0x03, 0xF0, 0x02, // 81 -0x00, 0x00, 0xF8, 0x03, 0x48, 0x00, 0x48, 0x00, 0xC8, 0x00, 0x30, 0x03, // 82 -0x00, 0x00, 0x30, 0x01, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, 0x90, 0x01, // 83 -0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0xF8, 0x03, 0x08, 0x00, 0x08, // 84 -0x00, 0x00, 0xF8, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0xF8, 0x01, // 85 -0x08, 0x00, 0x70, 0x00, 0x80, 0x01, 0x00, 0x02, 0x80, 0x01, 0x70, 0x00, 0x08, // 86 -0x18, 0x00, 0xE0, 0x01, 0x00, 0x02, 0xF0, 0x01, 0x08, 0x00, 0xF0, 0x01, 0x00, 0x02, 0xE0, 0x01, 0x18, // 87 -0x00, 0x02, 0x08, 0x01, 0x90, 0x00, 0x60, 0x00, 0x90, 0x00, 0x08, 0x01, 0x00, 0x02, // 88 -0x08, 0x00, 0x10, 0x00, 0x20, 0x00, 0xC0, 0x03, 0x20, 0x00, 0x10, 0x00, 0x08, // 89 -0x08, 0x03, 0x88, 0x02, 0xC8, 0x02, 0x68, 0x02, 0x38, 0x02, 0x18, 0x02, // 90 -0x00, 0x00, 0xF8, 0x0F, 0x08, 0x08, // 91 -0x18, 0x00, 0xE0, 0x00, 0x00, 0x03, // 92 -0x08, 0x08, 0xF8, 0x0F, // 93 -0x40, 0x00, 0x30, 0x00, 0x08, 0x00, 0x30, 0x00, 0x40, // 94 -0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, // 95 -0x08, 0x00, 0x10, // 96 -0x00, 0x00, 0x00, 0x03, 0xA0, 0x02, 0xA0, 0x02, 0xE0, 0x03, // 97 -0x00, 0x00, 0xF8, 0x03, 0x20, 0x02, 0x20, 0x02, 0xC0, 0x01, // 98 -0x00, 0x00, 0xC0, 0x01, 0x20, 0x02, 0x20, 0x02, 0x40, 0x01, // 99 -0x00, 0x00, 0xC0, 0x01, 0x20, 0x02, 0x20, 0x02, 0xF8, 0x03, // 100 -0x00, 0x00, 0xC0, 0x01, 0xA0, 0x02, 0xA0, 0x02, 0xC0, 0x02, // 101 -0x20, 0x00, 0xF0, 0x03, 0x28, // 102 -0x00, 0x00, 0xC0, 0x05, 0x20, 0x0A, 0x20, 0x0A, 0xE0, 0x07, // 103 -0x00, 0x00, 0xF8, 0x03, 0x20, 0x00, 0x20, 0x00, 0xC0, 0x03, // 104 -0x00, 0x00, 0xE8, 0x03, // 105 -0x00, 0x08, 0xE8, 0x07, // 106 -0xF8, 0x03, 0x80, 0x00, 0xC0, 0x01, 0x20, 0x02, // 107 -0x00, 0x00, 0xF8, 0x03, // 108 -0x00, 0x00, 0xE0, 0x03, 0x20, 0x00, 0x20, 0x00, 0xE0, 0x03, 0x20, 0x00, 0x20, 0x00, 0xC0, 0x03, // 109 -0x00, 0x00, 0xE0, 0x03, 0x20, 0x00, 0x20, 0x00, 0xC0, 0x03, // 110 -0x00, 0x00, 0xC0, 0x01, 0x20, 0x02, 0x20, 0x02, 0xC0, 0x01, // 111 -0x00, 0x00, 0xE0, 0x0F, 0x20, 0x02, 0x20, 0x02, 0xC0, 0x01, // 112 -0x00, 0x00, 0xC0, 0x01, 0x20, 0x02, 0x20, 0x02, 0xE0, 0x0F, // 113 -0x00, 0x00, 0xE0, 0x03, 0x20, // 114 -0x40, 0x02, 0xA0, 0x02, 0xA0, 0x02, 0x20, 0x01, // 115 -0x20, 0x00, 0xF8, 0x03, 0x20, 0x02, // 116 -0x00, 0x00, 0xE0, 0x01, 0x00, 0x02, 0x00, 0x02, 0xE0, 0x03, // 117 -0x20, 0x00, 0xC0, 0x01, 0x00, 0x02, 0xC0, 0x01, 0x20, // 118 -0xE0, 0x01, 0x00, 0x02, 0xC0, 0x01, 0x20, 0x00, 0xC0, 0x01, 0x00, 0x02, 0xE0, 0x01, // 119 -0x20, 0x02, 0x40, 0x01, 0x80, 0x00, 0x40, 0x01, 0x20, 0x02, // 120 -0x20, 0x00, 0xC0, 0x09, 0x00, 0x06, 0xC0, 0x01, 0x20, // 121 -0x20, 0x02, 0x20, 0x03, 0xA0, 0x02, 0x60, 0x02, 0x20, 0x02, // 122 -0x80, 0x00, 0x78, 0x0F, 0x08, 0x08, // 123 -0x00, 0x00, 0xF8, 0x0F, // 124 -0x08, 0x08, 0x78, 0x0F, 0x80, // 125 -0xC0, 0x00, 0x40, 0x00, 0xC0, 0x00, 0x80, 0x00, 0xC0, // 126 -0x00, 0x00, 0xA0, 0x0F, // 161 -0x00, 0x00, 0xC0, 0x01, 0xA0, 0x0F, 0x78, 0x02, 0x40, 0x01, // 162 -0x40, 0x02, 0x70, 0x03, 0xC8, 0x02, 0x48, 0x02, 0x08, 0x02, 0x10, 0x02, // 163 -0x00, 0x00, 0xE0, 0x01, 0x20, 0x01, 0x20, 0x01, 0xE0, 0x01, // 164 -0x00, 0x00, 0xF8, 0x03, 0x08, 0x00, 0x08, 0x00, 0x0C, // 165 -0x00, 0x00, 0x38, 0x0F, // 166 -0xD0, 0x04, 0x28, 0x09, 0x48, 0x09, 0x48, 0x0A, 0x90, 0x05, // 167 -0x00, 0x00, 0xE0, 0x03, 0xA8, 0x02, 0xA0, 0x02, 0xA8, 0x02, 0x20, 0x02, // 168 -0xE0, 0x00, 0x10, 0x01, 0x48, 0x02, 0xA8, 0x02, 0xA8, 0x02, 0x10, 0x01, 0xE0, // 169 -0x00, 0x00, 0xF0, 0x01, 0x58, 0x03, 0x48, 0x02, 0x08, 0x02, 0x10, 0x01, // 170 -0x00, 0x00, 0x80, 0x01, 0x40, 0x02, 0x80, 0x01, 0x40, 0x02, // 171 -0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0xE0, // 172 -0x80, 0x00, 0x80, // 173 -0xE0, 0x00, 0x10, 0x01, 0xE8, 0x02, 0x68, 0x02, 0xC8, 0x02, 0x10, 0x01, 0xE0, // 174 -0x00, 0x00, 0x08, 0x02, 0x0A, 0x02, 0xF8, 0x03, 0x0A, 0x02, 0x08, 0x02, // 175 -0x00, 0x00, 0x38, 0x00, 0x28, 0x00, 0x38, // 176 -0x40, 0x02, 0x40, 0x02, 0xF0, 0x03, 0x40, 0x02, 0x40, 0x02, // 177 -0x00, 0x00, 0x08, 0x02, 0x08, 0x02, 0xF8, 0x03, 0x08, 0x02, 0x08, 0x02, // 178 -0x00, 0x00, 0x20, 0x02, 0x20, 0x02, 0xE8, 0x03, 0x20, 0x02, 0x20, 0x02, // 179 -0x00, 0x00, 0xE0, 0x03, 0x20, 0x00, 0x30, // 180 -0x00, 0x00, 0xE0, 0x0F, 0x00, 0x02, 0x00, 0x02, 0xE0, 0x03, // 181 -0x70, 0x00, 0xF8, 0x0F, 0x08, 0x00, 0xF8, 0x0F, 0x08, // 182 -0x00, 0x00, 0x40, // 183 -0x00, 0x00, 0xC0, 0x01, 0xA8, 0x02, 0xA0, 0x02, 0xA8, 0x02, 0xC0, // 184 -0x00, 0x00, 0xF0, 0x03, 0x40, 0x00, 0x80, 0x00, 0xF8, 0x03, 0x08, // 185 -0x00, 0x00, 0xE0, 0x01, 0x50, 0x02, 0x50, 0x02, 0x10, 0x02, 0x20, 0x01, // 186 -0x00, 0x00, 0x40, 0x02, 0x80, 0x01, 0x40, 0x02, 0x80, 0x01, // 187 -0x00, 0x00, 0x10, 0x02, 0x78, 0x01, 0xC0, 0x00, 0x20, 0x01, 0x90, 0x01, 0xC8, 0x03, 0x00, 0x01, // 188 -0x00, 0x00, 0x10, 0x02, 0x78, 0x01, 0x80, 0x00, 0x60, 0x00, 0x50, 0x02, 0x48, 0x03, 0xC0, 0x02, // 189 -0x48, 0x00, 0x58, 0x00, 0x68, 0x03, 0x80, 0x00, 0x60, 0x01, 0x90, 0x01, 0xC8, 0x03, 0x00, 0x01, // 190 -0x00, 0x00, 0x00, 0x00, 0x28, 0x02, 0xE0, 0x03, 0x28, 0x02, // 191 -0x00, 0x00, 0xF0, 0x03, 0x88, 0x00, 0x88, 0x00, 0x88, 0x00, 0xF0, 0x03, // 192 -0x00, 0x00, 0xF8, 0x03, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, 0x88, 0x01, // 193 -0x00, 0x00, 0xF8, 0x03, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, 0xB0, 0x01, // 194 -0x00, 0x00, 0xF8, 0x03, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x18, // 195 -0x00, 0x00, 0x00, 0x02, 0xFC, 0x03, 0x04, 0x02, 0xFC, 0x03, 0x00, 0x02, // 196 -0x00, 0x00, 0xF8, 0x03, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, 0x08, 0x02, // 197 -0x00, 0x00, 0xB8, 0x03, 0x40, 0x00, 0xF8, 0x03, 0x40, 0x00, 0xB8, 0x03, // 198 -0x00, 0x00, 0x08, 0x02, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, 0xB0, 0x01, // 199 -0x00, 0x00, 0xF8, 0x03, 0x80, 0x00, 0x40, 0x00, 0x20, 0x00, 0xF8, 0x03, // 200 -0x00, 0x00, 0xE0, 0x03, 0x08, 0x01, 0x90, 0x00, 0x48, 0x00, 0xE0, 0x03, // 201 -0x00, 0x00, 0xF8, 0x03, 0x40, 0x00, 0xA0, 0x00, 0x10, 0x01, 0x08, 0x02, // 202 -0x00, 0x00, 0x00, 0x02, 0xF0, 0x01, 0x08, 0x00, 0x08, 0x00, 0xF8, 0x03, // 203 -0x00, 0x00, 0xF8, 0x03, 0x10, 0x00, 0x60, 0x00, 0x10, 0x00, 0xF8, 0x03, // 204 -0x00, 0x00, 0xF8, 0x03, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0xF8, 0x03, // 205 -0x00, 0x00, 0xF0, 0x01, 0x08, 0x02, 0x08, 0x02, 0x08, 0x02, 0xF0, 0x01, // 206 -0x00, 0x00, 0xF8, 0x03, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0xF8, 0x03, // 207 -0x00, 0x00, 0xF8, 0x03, 0x48, 0x00, 0x48, 0x00, 0x48, 0x00, 0x30, // 208 -0x00, 0x00, 0xF0, 0x01, 0x08, 0x02, 0x08, 0x02, 0x08, 0x02, 0x10, 0x01, // 209 -0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0xF8, 0x03, 0x08, 0x00, 0x08, // 210 -0x00, 0x00, 0x38, 0x00, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0xF8, 0x01, // 211 -0x00, 0x00, 0x70, 0x00, 0x88, 0x00, 0xF8, 0x03, 0x88, 0x00, 0x70, // 212 -0x00, 0x00, 0x18, 0x03, 0xA0, 0x00, 0x40, 0x00, 0xA0, 0x00, 0x18, 0x03, // 213 -0x00, 0x00, 0xF8, 0x03, 0x00, 0x02, 0x00, 0x02, 0xF8, 0x03, 0x00, 0x02, // 214 -0x00, 0x00, 0x38, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0xF8, 0x03, // 215 -0x00, 0x00, 0xF8, 0x03, 0x00, 0x02, 0xF8, 0x03, 0x00, 0x02, 0xF8, 0x03, // 216 -0x00, 0x00, 0xF8, 0x03, 0x00, 0x02, 0xF8, 0x03, 0x00, 0x02, 0xF8, 0x03, 0x00, 0x06, // 217 -0x00, 0x00, 0x08, 0x00, 0xF8, 0x03, 0x40, 0x02, 0x40, 0x02, 0x80, 0x01, // 218 -0x00, 0x00, 0xF8, 0x03, 0x40, 0x02, 0x40, 0x02, 0x80, 0x01, 0xF8, 0x03, // 219 -0x00, 0x00, 0xF8, 0x03, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x80, 0x01, // 220 -0x00, 0x00, 0x10, 0x01, 0x08, 0x02, 0x48, 0x02, 0x48, 0x02, 0xF0, 0x01, // 221 -0x00, 0x00, 0xF8, 0x03, 0x40, 0x00, 0xF0, 0x01, 0x08, 0x02, 0xF0, 0x01, // 222 -0x00, 0x00, 0x30, 0x02, 0x48, 0x01, 0xC8, 0x00, 0x48, 0x00, 0xF8, 0x03, // 223 -0x00, 0x00, 0x00, 0x01, 0xA0, 0x02, 0xA0, 0x02, 0xA0, 0x02, 0xC0, 0x03, // 224 -0x00, 0x00, 0xE0, 0x01, 0x50, 0x02, 0x50, 0x02, 0x48, 0x02, 0x88, 0x01, // 225 -0x00, 0x00, 0xE0, 0x03, 0xA0, 0x02, 0xA0, 0x02, 0xA0, 0x02, 0x40, 0x01, // 226 -0x00, 0x00, 0xE0, 0x03, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x60, // 227 -0x00, 0x00, 0x00, 0x02, 0xC0, 0x03, 0x20, 0x02, 0xE0, 0x03, 0x00, 0x02, // 228 -0x00, 0x00, 0xC0, 0x01, 0xA0, 0x02, 0xA0, 0x02, 0xA0, 0x02, 0xC0, // 229 -0x00, 0x00, 0x60, 0x03, 0x80, 0x00, 0xE0, 0x03, 0x80, 0x00, 0x60, 0x03, // 230 -0x00, 0x00, 0x20, 0x02, 0xA0, 0x02, 0xA0, 0x02, 0xA0, 0x02, 0x40, 0x01, // 231 -0x00, 0x00, 0xE0, 0x03, 0x00, 0x01, 0x80, 0x00, 0x40, 0x00, 0xE0, 0x03, // 232 -0x00, 0x00, 0xE0, 0x03, 0x00, 0x01, 0x98, 0x00, 0x40, 0x00, 0xE0, 0x03, // 233 -0x00, 0x00, 0xE0, 0x03, 0x80, 0x00, 0x80, 0x00, 0x40, 0x01, 0x20, 0x02, // 234 -0x00, 0x00, 0x00, 0x02, 0xC0, 0x01, 0x20, 0x00, 0x20, 0x00, 0xE0, 0x03, // 235 -0x00, 0x00, 0xE0, 0x03, 0x40, 0x00, 0x80, 0x00, 0x40, 0x00, 0xE0, 0x03, // 236 -0x00, 0x00, 0xE0, 0x03, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0xE0, 0x03, // 237 -0x00, 0x00, 0xC0, 0x01, 0x20, 0x02, 0x20, 0x02, 0x20, 0x02, 0xC0, 0x01, // 238 -0x00, 0x00, 0xE0, 0x03, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0xE0, 0x03, // 239 -0x00, 0x00, 0xE0, 0x03, 0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0x40, // 240 -0x00, 0x00, 0xC0, 0x01, 0x20, 0x02, 0x20, 0x02, 0x20, 0x02, 0x40, 0x02, // 241 -0x00, 0x00, 0x20, 0x00, 0x20, 0x00, 0xE0, 0x03, 0x20, 0x00, 0x20, // 242 -0x00, 0x00, 0x60, 0x00, 0x80, 0x02, 0x80, 0x02, 0x80, 0x02, 0xE0, 0x01, // 243 -0x00, 0x00, 0xC0, 0x00, 0x20, 0x01, 0xE0, 0x03, 0x20, 0x01, 0xC0, // 244 -0x00, 0x00, 0x20, 0x02, 0x40, 0x01, 0x80, 0x00, 0x40, 0x01, 0x20, 0x02, // 245 -0x00, 0x00, 0xE0, 0x03, 0x00, 0x02, 0x00, 0x02, 0xE0, 0x03, 0x00, 0x02, // 246 -0x00, 0x00, 0x60, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0xE0, 0x03, // 247 -0x00, 0x00, 0xE0, 0x03, 0x00, 0x02, 0xE0, 0x03, 0x00, 0x02, 0xE0, 0x03, // 248 -0x00, 0x00, 0xE0, 0x03, 0x00, 0x02, 0xE0, 0x03, 0x00, 0x02, 0xE0, 0x03, 0x00, 0x06, // 249 -0x00, 0x00, 0x20, 0x00, 0xE0, 0x03, 0x80, 0x02, 0x80, 0x02, 0x00, 0x01, // 250 -0x00, 0x00, 0xE0, 0x03, 0x80, 0x02, 0x80, 0x02, 0x00, 0x01, 0xE0, 0x03, // 251 -0x00, 0x00, 0xE0, 0x03, 0x80, 0x02, 0x80, 0x02, 0x80, 0x02, 0x00, 0x01, // 252 -0x00, 0x00, 0x40, 0x01, 0x20, 0x02, 0xA0, 0x02, 0xA0, 0x02, 0xC0, 0x01, // 253 -0x00, 0x00, 0xE0, 0x03, 0x80, 0x00, 0xC0, 0x01, 0x20, 0x02, 0xC0, 0x01, // 254 -0x00, 0x00, 0x40, 0x02, 0xA0, 0x01, 0xA0, 0x00, 0xA0, 0x00, 0xE0, 0x03, // 255 + 0x0A, // Width: 10 + 0x0D, // Height: 13 + 0x20, // First char: 32 + 0xE0, // Number of chars: 224 + // Jump Table: + 0xFF, 0xFF, 0x00, 0x0A, // 32 + 0x00, 0x00, 0x04, 0x03, // 33 + 0x00, 0x04, 0x05, 0x04, // 34 + 0x00, 0x09, 0x09, 0x06, // 35 + 0x00, 0x12, 0x0A, 0x06, // 36 + 0x00, 0x1C, 0x10, 0x09, // 37 + 0x00, 0x2C, 0x0E, 0x08, // 38 + 0x00, 0x3A, 0x01, 0x02, // 39 + 0x00, 0x3B, 0x06, 0x04, // 40 + 0x00, 0x41, 0x06, 0x04, // 41 + 0x00, 0x47, 0x05, 0x04, // 42 + 0x00, 0x4C, 0x09, 0x06, // 43 + 0x00, 0x55, 0x04, 0x03, // 44 + 0x00, 0x59, 0x03, 0x03, // 45 + 0x00, 0x5C, 0x04, 0x03, // 46 + 0x00, 0x60, 0x05, 0x04, // 47 + 0x00, 0x65, 0x0A, 0x06, // 48 + 0x00, 0x6F, 0x08, 0x05, // 49 + 0x00, 0x77, 0x0A, 0x06, // 50 + 0x00, 0x81, 0x0A, 0x06, // 51 + 0x00, 0x8B, 0x0B, 0x07, // 52 + 0x00, 0x96, 0x0A, 0x06, // 53 + 0x00, 0xA0, 0x0A, 0x06, // 54 + 0x00, 0xAA, 0x09, 0x06, // 55 + 0x00, 0xB3, 0x0A, 0x06, // 56 + 0x00, 0xBD, 0x0A, 0x06, // 57 + 0x00, 0xC7, 0x04, 0x03, // 58 + 0x00, 0xCB, 0x04, 0x03, // 59 + 0x00, 0xCF, 0x0A, 0x06, // 60 + 0x00, 0xD9, 0x09, 0x06, // 61 + 0x00, 0xE2, 0x09, 0x06, // 62 + 0x00, 0xEB, 0x0B, 0x07, // 63 + 0x00, 0xF6, 0x14, 0x0B, // 64 + 0x01, 0x0A, 0x0E, 0x08, // 65 + 0x01, 0x18, 0x0C, 0x07, // 66 + 0x01, 0x24, 0x0C, 0x07, // 67 + 0x01, 0x30, 0x0B, 0x07, // 68 + 0x01, 0x3B, 0x0C, 0x07, // 69 + 0x01, 0x47, 0x09, 0x06, // 70 + 0x01, 0x50, 0x0D, 0x08, // 71 + 0x01, 0x5D, 0x0C, 0x07, // 72 + 0x01, 0x69, 0x04, 0x03, // 73 + 0x01, 0x6D, 0x08, 0x05, // 74 + 0x01, 0x75, 0x0E, 0x08, // 75 + 0x01, 0x83, 0x0C, 0x07, // 76 + 0x01, 0x8F, 0x10, 0x09, // 77 + 0x01, 0x9F, 0x0C, 0x07, // 78 + 0x01, 0xAB, 0x0E, 0x08, // 79 + 0x01, 0xB9, 0x0B, 0x07, // 80 + 0x01, 0xC4, 0x0E, 0x08, // 81 + 0x01, 0xD2, 0x0C, 0x07, // 82 + 0x01, 0xDE, 0x0C, 0x07, // 83 + 0x01, 0xEA, 0x0B, 0x07, // 84 + 0x01, 0xF5, 0x0C, 0x07, // 85 + 0x02, 0x01, 0x0D, 0x08, // 86 + 0x02, 0x0E, 0x11, 0x0A, // 87 + 0x02, 0x1F, 0x0E, 0x08, // 88 + 0x02, 0x2D, 0x0D, 0x08, // 89 + 0x02, 0x3A, 0x0C, 0x07, // 90 + 0x02, 0x46, 0x06, 0x04, // 91 + 0x02, 0x4C, 0x06, 0x04, // 92 + 0x02, 0x52, 0x04, 0x03, // 93 + 0x02, 0x56, 0x09, 0x06, // 94 + 0x02, 0x5F, 0x0C, 0x07, // 95 + 0x02, 0x6B, 0x03, 0x03, // 96 + 0x02, 0x6E, 0x0A, 0x06, // 97 + 0x02, 0x78, 0x0A, 0x06, // 98 + 0x02, 0x82, 0x0A, 0x06, // 99 + 0x02, 0x8C, 0x0A, 0x06, // 100 + 0x02, 0x96, 0x0A, 0x06, // 101 + 0x02, 0xA0, 0x05, 0x04, // 102 + 0x02, 0xA5, 0x0A, 0x06, // 103 + 0x02, 0xAF, 0x0A, 0x06, // 104 + 0x02, 0xB9, 0x04, 0x03, // 105 + 0x02, 0xBD, 0x04, 0x03, // 106 + 0x02, 0xC1, 0x08, 0x05, // 107 + 0x02, 0xC9, 0x04, 0x03, // 108 + 0x02, 0xCD, 0x10, 0x09, // 109 + 0x02, 0xDD, 0x0A, 0x06, // 110 + 0x02, 0xE7, 0x0A, 0x06, // 111 + 0x02, 0xF1, 0x0A, 0x06, // 112 + 0x02, 0xFB, 0x0A, 0x06, // 113 + 0x03, 0x05, 0x05, 0x04, // 114 + 0x03, 0x0A, 0x08, 0x05, // 115 + 0x03, 0x12, 0x06, 0x04, // 116 + 0x03, 0x18, 0x0A, 0x06, // 117 + 0x03, 0x22, 0x09, 0x06, // 118 + 0x03, 0x2B, 0x0E, 0x08, // 119 + 0x03, 0x39, 0x0A, 0x06, // 120 + 0x03, 0x43, 0x09, 0x06, // 121 + 0x03, 0x4C, 0x0A, 0x06, // 122 + 0x03, 0x56, 0x06, 0x04, // 123 + 0x03, 0x5C, 0x04, 0x03, // 124 + 0x03, 0x60, 0x05, 0x04, // 125 + 0x03, 0x65, 0x09, 0x06, // 126 + 0xFF, 0xFF, 0x00, 0x0A, // 127 + 0xFF, 0xFF, 0x00, 0x0A, // 128 + 0xFF, 0xFF, 0x00, 0x0A, // 129 + 0xFF, 0xFF, 0x00, 0x0A, // 130 + 0xFF, 0xFF, 0x00, 0x0A, // 131 + 0xFF, 0xFF, 0x00, 0x0A, // 132 + 0xFF, 0xFF, 0x00, 0x0A, // 133 + 0xFF, 0xFF, 0x00, 0x0A, // 134 + 0xFF, 0xFF, 0x00, 0x0A, // 135 + 0xFF, 0xFF, 0x00, 0x0A, // 136 + 0xFF, 0xFF, 0x00, 0x0A, // 137 + 0xFF, 0xFF, 0x00, 0x0A, // 138 + 0xFF, 0xFF, 0x00, 0x0A, // 139 + 0xFF, 0xFF, 0x00, 0x0A, // 140 + 0xFF, 0xFF, 0x00, 0x0A, // 141 + 0xFF, 0xFF, 0x00, 0x0A, // 142 + 0xFF, 0xFF, 0x00, 0x0A, // 143 + 0xFF, 0xFF, 0x00, 0x0A, // 144 + 0xFF, 0xFF, 0x00, 0x0A, // 145 + 0xFF, 0xFF, 0x00, 0x0A, // 146 + 0xFF, 0xFF, 0x00, 0x0A, // 147 + 0xFF, 0xFF, 0x00, 0x0A, // 148 + 0xFF, 0xFF, 0x00, 0x0A, // 149 + 0xFF, 0xFF, 0x00, 0x0A, // 150 + 0xFF, 0xFF, 0x00, 0x0A, // 151 + 0xFF, 0xFF, 0x00, 0x0A, // 152 + 0xFF, 0xFF, 0x00, 0x0A, // 153 + 0xFF, 0xFF, 0x00, 0x0A, // 154 + 0xFF, 0xFF, 0x00, 0x0A, // 155 + 0xFF, 0xFF, 0x00, 0x0A, // 156 + 0xFF, 0xFF, 0x00, 0x0A, // 157 + 0xFF, 0xFF, 0x00, 0x0A, // 158 + 0xFF, 0xFF, 0x00, 0x0A, // 159 + 0xFF, 0xFF, 0x00, 0x0A, // 160 + 0x03, 0x6E, 0x04, 0x03, // 161 + 0x03, 0x72, 0x0A, 0x06, // 162 + 0x03, 0x7C, 0x0C, 0x07, // 163 + 0x03, 0x88, 0x0A, 0x06, // 164 + 0x03, 0x92, 0x09, 0x06, // 165 + 0x03, 0x9B, 0x04, 0x03, // 166 + 0x03, 0x9F, 0x0A, 0x06, // 167 + 0x03, 0xA9, 0x0C, 0x07, // 168 + 0x03, 0xB5, 0x0D, 0x08, // 169 + 0x03, 0xC2, 0x0C, 0x07, // 170 + 0x03, 0xCE, 0x0A, 0x06, // 171 + 0x03, 0xD8, 0x09, 0x06, // 172 + 0x03, 0xE1, 0x03, 0x03, // 173 + 0x03, 0xE4, 0x0D, 0x08, // 174 + 0x03, 0xF1, 0x0C, 0x07, // 175 + 0x03, 0xFD, 0x07, 0x05, // 176 + 0x04, 0x04, 0x0A, 0x06, // 177 + 0x04, 0x0E, 0x0C, 0x07, // 178 + 0x04, 0x1A, 0x0C, 0x07, // 179 + 0x04, 0x26, 0x07, 0x05, // 180 + 0x04, 0x2D, 0x0A, 0x06, // 181 + 0x04, 0x37, 0x09, 0x06, // 182 + 0x04, 0x40, 0x03, 0x03, // 183 + 0x04, 0x43, 0x0B, 0x07, // 184 + 0x04, 0x4E, 0x0B, 0x07, // 185 + 0x04, 0x59, 0x0C, 0x07, // 186 + 0x04, 0x65, 0x0A, 0x06, // 187 + 0x04, 0x6F, 0x10, 0x09, // 188 + 0x04, 0x7F, 0x10, 0x09, // 189 + 0x04, 0x8F, 0x10, 0x09, // 190 + 0x04, 0x9F, 0x0A, 0x06, // 191 + 0x04, 0xA9, 0x0C, 0x07, // 192 + 0x04, 0xB5, 0x0C, 0x07, // 193 + 0x04, 0xC1, 0x0C, 0x07, // 194 + 0x04, 0xCD, 0x0B, 0x07, // 195 + 0x04, 0xD8, 0x0C, 0x07, // 196 + 0x04, 0xE4, 0x0C, 0x07, // 197 + 0x04, 0xF0, 0x0C, 0x07, // 198 + 0x04, 0xFC, 0x0C, 0x07, // 199 + 0x05, 0x08, 0x0C, 0x07, // 200 + 0x05, 0x14, 0x0C, 0x07, // 201 + 0x05, 0x20, 0x0C, 0x07, // 202 + 0x05, 0x2C, 0x0C, 0x07, // 203 + 0x05, 0x38, 0x0C, 0x07, // 204 + 0x05, 0x44, 0x0C, 0x07, // 205 + 0x05, 0x50, 0x0C, 0x07, // 206 + 0x05, 0x5C, 0x0C, 0x07, // 207 + 0x05, 0x68, 0x0B, 0x07, // 208 + 0x05, 0x73, 0x0C, 0x07, // 209 + 0x05, 0x7F, 0x0B, 0x07, // 210 + 0x05, 0x8A, 0x0C, 0x07, // 211 + 0x05, 0x96, 0x0B, 0x07, // 212 + 0x05, 0xA1, 0x0C, 0x07, // 213 + 0x05, 0xAD, 0x0C, 0x07, // 214 + 0x05, 0xB9, 0x0C, 0x07, // 215 + 0x05, 0xC5, 0x0C, 0x07, // 216 + 0x05, 0xD1, 0x0E, 0x08, // 217 + 0x05, 0xDF, 0x0C, 0x07, // 218 + 0x05, 0xEB, 0x0C, 0x07, // 219 + 0x05, 0xF7, 0x0C, 0x07, // 220 + 0x06, 0x03, 0x0C, 0x07, // 221 + 0x06, 0x0F, 0x0C, 0x07, // 222 + 0x06, 0x1B, 0x0C, 0x07, // 223 + 0x06, 0x27, 0x0C, 0x07, // 224 + 0x06, 0x33, 0x0C, 0x07, // 225 + 0x06, 0x3F, 0x0C, 0x07, // 226 + 0x06, 0x4B, 0x0B, 0x07, // 227 + 0x06, 0x56, 0x0C, 0x07, // 228 + 0x06, 0x62, 0x0B, 0x07, // 229 + 0x06, 0x6D, 0x0C, 0x07, // 230 + 0x06, 0x79, 0x0C, 0x07, // 231 + 0x06, 0x85, 0x0C, 0x07, // 232 + 0x06, 0x91, 0x0C, 0x07, // 233 + 0x06, 0x9D, 0x0C, 0x07, // 234 + 0x06, 0xA9, 0x0C, 0x07, // 235 + 0x06, 0xB5, 0x0C, 0x07, // 236 + 0x06, 0xC1, 0x0C, 0x07, // 237 + 0x06, 0xCD, 0x0C, 0x07, // 238 + 0x06, 0xD9, 0x0C, 0x07, // 239 + 0x06, 0xE5, 0x0B, 0x07, // 240 + 0x06, 0xF0, 0x0C, 0x07, // 241 + 0x06, 0xFC, 0x0B, 0x07, // 242 + 0x07, 0x07, 0x0C, 0x07, // 243 + 0x07, 0x13, 0x0B, 0x07, // 244 + 0x07, 0x1E, 0x0C, 0x07, // 245 + 0x07, 0x2A, 0x0C, 0x07, // 246 + 0x07, 0x36, 0x0C, 0x07, // 247 + 0x07, 0x42, 0x0C, 0x07, // 248 + 0x07, 0x4E, 0x0E, 0x08, // 249 + 0x07, 0x5C, 0x0C, 0x07, // 250 + 0x07, 0x68, 0x0C, 0x07, // 251 + 0x07, 0x74, 0x0C, 0x07, // 252 + 0x07, 0x80, 0x0C, 0x07, // 253 + 0x07, 0x8C, 0x0C, 0x07, // 254 + 0x07, 0x98, 0x0C, 0x07, // 255 + // Font Data: + 0x00, 0x00, 0xF8, 0x02, // 33 + 0x38, 0x00, 0x00, 0x00, 0x38, // 34 + 0xA0, 0x03, 0xE0, 0x00, 0xB8, 0x03, 0xE0, 0x00, 0xB8, // 35 + 0x30, 0x01, 0x28, 0x02, 0xF8, 0x07, 0x48, 0x02, 0x90, 0x01, // 36 + 0x00, 0x00, 0x30, 0x00, 0x48, 0x00, 0x30, 0x03, 0xC0, 0x00, 0xB0, 0x01, 0x48, 0x02, 0x80, 0x01, // 37 + 0x80, 0x01, 0x50, 0x02, 0x68, 0x02, 0xA8, 0x02, 0x18, 0x01, 0x80, 0x03, 0x80, 0x02, // 38 + 0x38, // 39 + 0xE0, 0x03, 0x10, 0x04, 0x08, 0x08, // 40 + 0x08, 0x08, 0x10, 0x04, 0xE0, 0x03, // 41 + 0x28, 0x00, 0x18, 0x00, 0x28, // 42 + 0x40, 0x00, 0x40, 0x00, 0xF0, 0x01, 0x40, 0x00, 0x40, // 43 + 0x00, 0x00, 0x00, 0x06, // 44 + 0x80, 0x00, 0x80, // 45 + 0x00, 0x00, 0x00, 0x02, // 46 + 0x00, 0x03, 0xE0, 0x00, 0x18, // 47 + 0xF0, 0x01, 0x08, 0x02, 0x08, 0x02, 0x08, 0x02, 0xF0, 0x01, // 48 + 0x00, 0x00, 0x20, 0x00, 0x10, 0x00, 0xF8, 0x03, // 49 + 0x10, 0x02, 0x08, 0x03, 0x88, 0x02, 0x48, 0x02, 0x30, 0x02, // 50 + 0x10, 0x01, 0x08, 0x02, 0x48, 0x02, 0x48, 0x02, 0xB0, 0x01, // 51 + 0xC0, 0x00, 0xA0, 0x00, 0x90, 0x00, 0x88, 0x00, 0xF8, 0x03, 0x80, // 52 + 0x60, 0x01, 0x38, 0x02, 0x28, 0x02, 0x28, 0x02, 0xC8, 0x01, // 53 + 0xF0, 0x01, 0x28, 0x02, 0x28, 0x02, 0x28, 0x02, 0xD0, 0x01, // 54 + 0x08, 0x00, 0x08, 0x03, 0xC8, 0x00, 0x38, 0x00, 0x08, // 55 + 0xB0, 0x01, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, 0xB0, 0x01, // 56 + 0x70, 0x01, 0x88, 0x02, 0x88, 0x02, 0x88, 0x02, 0xF0, 0x01, // 57 + 0x00, 0x00, 0x20, 0x02, // 58 + 0x00, 0x00, 0x20, 0x06, // 59 + 0x00, 0x00, 0x40, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0x10, 0x01, // 60 + 0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0, // 61 + 0x00, 0x00, 0x10, 0x01, 0xA0, 0x00, 0xA0, 0x00, 0x40, // 62 + 0x10, 0x00, 0x08, 0x00, 0x08, 0x00, 0xC8, 0x02, 0x48, 0x00, 0x30, // 63 + 0x00, 0x00, 0xC0, 0x03, 0x30, 0x04, 0xD0, 0x09, 0x28, 0x0A, 0x28, 0x0A, 0xC8, 0x0B, 0x68, 0x0A, 0x10, 0x05, 0xE0, 0x04, // 64 + 0x00, 0x02, 0xC0, 0x01, 0xB0, 0x00, 0x88, 0x00, 0xB0, 0x00, 0xC0, 0x01, 0x00, 0x02, // 65 + 0x00, 0x00, 0xF8, 0x03, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, 0xF0, 0x01, // 66 + 0x00, 0x00, 0xF0, 0x01, 0x08, 0x02, 0x08, 0x02, 0x08, 0x02, 0x10, 0x01, // 67 + 0x00, 0x00, 0xF8, 0x03, 0x08, 0x02, 0x08, 0x02, 0x10, 0x01, 0xE0, // 68 + 0x00, 0x00, 0xF8, 0x03, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, // 69 + 0x00, 0x00, 0xF8, 0x03, 0x48, 0x00, 0x48, 0x00, 0x08, // 70 + 0x00, 0x00, 0xE0, 0x00, 0x10, 0x01, 0x08, 0x02, 0x48, 0x02, 0x50, 0x01, 0xC0, // 71 + 0x00, 0x00, 0xF8, 0x03, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0xF8, 0x03, // 72 + 0x00, 0x00, 0xF8, 0x03, // 73 + 0x00, 0x03, 0x00, 0x02, 0x00, 0x02, 0xF8, 0x01, // 74 + 0x00, 0x00, 0xF8, 0x03, 0x80, 0x00, 0x60, 0x00, 0x90, 0x00, 0x08, 0x01, 0x00, 0x02, // 75 + 0x00, 0x00, 0xF8, 0x03, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, // 76 + 0x00, 0x00, 0xF8, 0x03, 0x30, 0x00, 0xC0, 0x01, 0x00, 0x02, 0xC0, 0x01, 0x30, 0x00, 0xF8, 0x03, // 77 + 0x00, 0x00, 0xF8, 0x03, 0x30, 0x00, 0x40, 0x00, 0x80, 0x01, 0xF8, 0x03, // 78 + 0x00, 0x00, 0xF0, 0x01, 0x08, 0x02, 0x08, 0x02, 0x08, 0x02, 0x08, 0x02, 0xF0, 0x01, // 79 + 0x00, 0x00, 0xF8, 0x03, 0x48, 0x00, 0x48, 0x00, 0x48, 0x00, 0x30, // 80 + 0x00, 0x00, 0xF0, 0x01, 0x08, 0x02, 0x08, 0x02, 0x08, 0x03, 0x08, 0x03, 0xF0, 0x02, // 81 + 0x00, 0x00, 0xF8, 0x03, 0x48, 0x00, 0x48, 0x00, 0xC8, 0x00, 0x30, 0x03, // 82 + 0x00, 0x00, 0x30, 0x01, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, 0x90, 0x01, // 83 + 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0xF8, 0x03, 0x08, 0x00, 0x08, // 84 + 0x00, 0x00, 0xF8, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0xF8, 0x01, // 85 + 0x08, 0x00, 0x70, 0x00, 0x80, 0x01, 0x00, 0x02, 0x80, 0x01, 0x70, 0x00, 0x08, // 86 + 0x18, 0x00, 0xE0, 0x01, 0x00, 0x02, 0xF0, 0x01, 0x08, 0x00, 0xF0, 0x01, 0x00, 0x02, 0xE0, 0x01, 0x18, // 87 + 0x00, 0x02, 0x08, 0x01, 0x90, 0x00, 0x60, 0x00, 0x90, 0x00, 0x08, 0x01, 0x00, 0x02, // 88 + 0x08, 0x00, 0x10, 0x00, 0x20, 0x00, 0xC0, 0x03, 0x20, 0x00, 0x10, 0x00, 0x08, // 89 + 0x08, 0x03, 0x88, 0x02, 0xC8, 0x02, 0x68, 0x02, 0x38, 0x02, 0x18, 0x02, // 90 + 0x00, 0x00, 0xF8, 0x0F, 0x08, 0x08, // 91 + 0x18, 0x00, 0xE0, 0x00, 0x00, 0x03, // 92 + 0x08, 0x08, 0xF8, 0x0F, // 93 + 0x40, 0x00, 0x30, 0x00, 0x08, 0x00, 0x30, 0x00, 0x40, // 94 + 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, // 95 + 0x08, 0x00, 0x10, // 96 + 0x00, 0x00, 0x00, 0x03, 0xA0, 0x02, 0xA0, 0x02, 0xE0, 0x03, // 97 + 0x00, 0x00, 0xF8, 0x03, 0x20, 0x02, 0x20, 0x02, 0xC0, 0x01, // 98 + 0x00, 0x00, 0xC0, 0x01, 0x20, 0x02, 0x20, 0x02, 0x40, 0x01, // 99 + 0x00, 0x00, 0xC0, 0x01, 0x20, 0x02, 0x20, 0x02, 0xF8, 0x03, // 100 + 0x00, 0x00, 0xC0, 0x01, 0xA0, 0x02, 0xA0, 0x02, 0xC0, 0x02, // 101 + 0x20, 0x00, 0xF0, 0x03, 0x28, // 102 + 0x00, 0x00, 0xC0, 0x05, 0x20, 0x0A, 0x20, 0x0A, 0xE0, 0x07, // 103 + 0x00, 0x00, 0xF8, 0x03, 0x20, 0x00, 0x20, 0x00, 0xC0, 0x03, // 104 + 0x00, 0x00, 0xE8, 0x03, // 105 + 0x00, 0x08, 0xE8, 0x07, // 106 + 0xF8, 0x03, 0x80, 0x00, 0xC0, 0x01, 0x20, 0x02, // 107 + 0x00, 0x00, 0xF8, 0x03, // 108 + 0x00, 0x00, 0xE0, 0x03, 0x20, 0x00, 0x20, 0x00, 0xE0, 0x03, 0x20, 0x00, 0x20, 0x00, 0xC0, 0x03, // 109 + 0x00, 0x00, 0xE0, 0x03, 0x20, 0x00, 0x20, 0x00, 0xC0, 0x03, // 110 + 0x00, 0x00, 0xC0, 0x01, 0x20, 0x02, 0x20, 0x02, 0xC0, 0x01, // 111 + 0x00, 0x00, 0xE0, 0x0F, 0x20, 0x02, 0x20, 0x02, 0xC0, 0x01, // 112 + 0x00, 0x00, 0xC0, 0x01, 0x20, 0x02, 0x20, 0x02, 0xE0, 0x0F, // 113 + 0x00, 0x00, 0xE0, 0x03, 0x20, // 114 + 0x40, 0x02, 0xA0, 0x02, 0xA0, 0x02, 0x20, 0x01, // 115 + 0x20, 0x00, 0xF8, 0x03, 0x20, 0x02, // 116 + 0x00, 0x00, 0xE0, 0x01, 0x00, 0x02, 0x00, 0x02, 0xE0, 0x03, // 117 + 0x20, 0x00, 0xC0, 0x01, 0x00, 0x02, 0xC0, 0x01, 0x20, // 118 + 0xE0, 0x01, 0x00, 0x02, 0xC0, 0x01, 0x20, 0x00, 0xC0, 0x01, 0x00, 0x02, 0xE0, 0x01, // 119 + 0x20, 0x02, 0x40, 0x01, 0x80, 0x00, 0x40, 0x01, 0x20, 0x02, // 120 + 0x20, 0x00, 0xC0, 0x09, 0x00, 0x06, 0xC0, 0x01, 0x20, // 121 + 0x20, 0x02, 0x20, 0x03, 0xA0, 0x02, 0x60, 0x02, 0x20, 0x02, // 122 + 0x80, 0x00, 0x78, 0x0F, 0x08, 0x08, // 123 + 0x00, 0x00, 0xF8, 0x0F, // 124 + 0x08, 0x08, 0x78, 0x0F, 0x80, // 125 + 0xC0, 0x00, 0x40, 0x00, 0xC0, 0x00, 0x80, 0x00, 0xC0, // 126 + 0x00, 0x00, 0xA0, 0x0F, // 161 + 0x00, 0x00, 0xC0, 0x01, 0xA0, 0x0F, 0x78, 0x02, 0x40, 0x01, // 162 + 0x40, 0x02, 0x70, 0x03, 0xC8, 0x02, 0x48, 0x02, 0x08, 0x02, 0x10, 0x02, // 163 + 0x00, 0x00, 0xE0, 0x01, 0x20, 0x01, 0x20, 0x01, 0xE0, 0x01, // 164 + 0x00, 0x00, 0xF8, 0x03, 0x08, 0x00, 0x08, 0x00, 0x0C, // 165 + 0x00, 0x00, 0x38, 0x0F, // 166 + 0xD0, 0x04, 0x28, 0x09, 0x48, 0x09, 0x48, 0x0A, 0x90, 0x05, // 167 + 0x00, 0x00, 0xE0, 0x03, 0xA8, 0x02, 0xA0, 0x02, 0xA8, 0x02, 0x20, 0x02, // 168 + 0xE0, 0x00, 0x10, 0x01, 0x48, 0x02, 0xA8, 0x02, 0xA8, 0x02, 0x10, 0x01, 0xE0, // 169 + 0x00, 0x00, 0xF0, 0x01, 0x58, 0x03, 0x48, 0x02, 0x08, 0x02, 0x10, 0x01, // 170 + 0x00, 0x00, 0x80, 0x01, 0x40, 0x02, 0x80, 0x01, 0x40, 0x02, // 171 + 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0xE0, // 172 + 0x80, 0x00, 0x80, // 173 + 0xE0, 0x00, 0x10, 0x01, 0xE8, 0x02, 0x68, 0x02, 0xC8, 0x02, 0x10, 0x01, 0xE0, // 174 + 0x00, 0x00, 0x08, 0x02, 0x0A, 0x02, 0xF8, 0x03, 0x0A, 0x02, 0x08, 0x02, // 175 + 0x00, 0x00, 0x38, 0x00, 0x28, 0x00, 0x38, // 176 + 0x40, 0x02, 0x40, 0x02, 0xF0, 0x03, 0x40, 0x02, 0x40, 0x02, // 177 + 0x00, 0x00, 0x08, 0x02, 0x08, 0x02, 0xF8, 0x03, 0x08, 0x02, 0x08, 0x02, // 178 + 0x00, 0x00, 0x20, 0x02, 0x20, 0x02, 0xE8, 0x03, 0x20, 0x02, 0x20, 0x02, // 179 + 0x00, 0x00, 0xE0, 0x03, 0x20, 0x00, 0x30, // 180 + 0x00, 0x00, 0xE0, 0x0F, 0x00, 0x02, 0x00, 0x02, 0xE0, 0x03, // 181 + 0x70, 0x00, 0xF8, 0x0F, 0x08, 0x00, 0xF8, 0x0F, 0x08, // 182 + 0x00, 0x00, 0x40, // 183 + 0x00, 0x00, 0xC0, 0x01, 0xA8, 0x02, 0xA0, 0x02, 0xA8, 0x02, 0xC0, // 184 + 0x00, 0x00, 0xF0, 0x03, 0x40, 0x00, 0x80, 0x00, 0xF8, 0x03, 0x08, // 185 + 0x00, 0x00, 0xE0, 0x01, 0x50, 0x02, 0x50, 0x02, 0x10, 0x02, 0x20, 0x01, // 186 + 0x00, 0x00, 0x40, 0x02, 0x80, 0x01, 0x40, 0x02, 0x80, 0x01, // 187 + 0x00, 0x00, 0x10, 0x02, 0x78, 0x01, 0xC0, 0x00, 0x20, 0x01, 0x90, 0x01, 0xC8, 0x03, 0x00, 0x01, // 188 + 0x00, 0x00, 0x10, 0x02, 0x78, 0x01, 0x80, 0x00, 0x60, 0x00, 0x50, 0x02, 0x48, 0x03, 0xC0, 0x02, // 189 + 0x48, 0x00, 0x58, 0x00, 0x68, 0x03, 0x80, 0x00, 0x60, 0x01, 0x90, 0x01, 0xC8, 0x03, 0x00, 0x01, // 190 + 0x00, 0x00, 0x00, 0x00, 0x28, 0x02, 0xE0, 0x03, 0x28, 0x02, // 191 + 0x00, 0x00, 0xF0, 0x03, 0x88, 0x00, 0x88, 0x00, 0x88, 0x00, 0xF0, 0x03, // 192 + 0x00, 0x00, 0xF8, 0x03, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, 0x88, 0x01, // 193 + 0x00, 0x00, 0xF8, 0x03, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, 0xB0, 0x01, // 194 + 0x00, 0x00, 0xF8, 0x03, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x18, // 195 + 0x00, 0x00, 0x00, 0x02, 0xFC, 0x03, 0x04, 0x02, 0xFC, 0x03, 0x00, 0x02, // 196 + 0x00, 0x00, 0xF8, 0x03, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, 0x08, 0x02, // 197 + 0x00, 0x00, 0xB8, 0x03, 0x40, 0x00, 0xF8, 0x03, 0x40, 0x00, 0xB8, 0x03, // 198 + 0x00, 0x00, 0x08, 0x02, 0x48, 0x02, 0x48, 0x02, 0x48, 0x02, 0xB0, 0x01, // 199 + 0x00, 0x00, 0xF8, 0x03, 0x80, 0x00, 0x40, 0x00, 0x20, 0x00, 0xF8, 0x03, // 200 + 0x00, 0x00, 0xE0, 0x03, 0x08, 0x01, 0x90, 0x00, 0x48, 0x00, 0xE0, 0x03, // 201 + 0x00, 0x00, 0xF8, 0x03, 0x40, 0x00, 0xA0, 0x00, 0x10, 0x01, 0x08, 0x02, // 202 + 0x00, 0x00, 0x00, 0x02, 0xF0, 0x01, 0x08, 0x00, 0x08, 0x00, 0xF8, 0x03, // 203 + 0x00, 0x00, 0xF8, 0x03, 0x10, 0x00, 0x60, 0x00, 0x10, 0x00, 0xF8, 0x03, // 204 + 0x00, 0x00, 0xF8, 0x03, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0xF8, 0x03, // 205 + 0x00, 0x00, 0xF0, 0x01, 0x08, 0x02, 0x08, 0x02, 0x08, 0x02, 0xF0, 0x01, // 206 + 0x00, 0x00, 0xF8, 0x03, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0xF8, 0x03, // 207 + 0x00, 0x00, 0xF8, 0x03, 0x48, 0x00, 0x48, 0x00, 0x48, 0x00, 0x30, // 208 + 0x00, 0x00, 0xF0, 0x01, 0x08, 0x02, 0x08, 0x02, 0x08, 0x02, 0x10, 0x01, // 209 + 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0xF8, 0x03, 0x08, 0x00, 0x08, // 210 + 0x00, 0x00, 0x38, 0x00, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0xF8, 0x01, // 211 + 0x00, 0x00, 0x70, 0x00, 0x88, 0x00, 0xF8, 0x03, 0x88, 0x00, 0x70, // 212 + 0x00, 0x00, 0x18, 0x03, 0xA0, 0x00, 0x40, 0x00, 0xA0, 0x00, 0x18, 0x03, // 213 + 0x00, 0x00, 0xF8, 0x03, 0x00, 0x02, 0x00, 0x02, 0xF8, 0x03, 0x00, 0x02, // 214 + 0x00, 0x00, 0x38, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0xF8, 0x03, // 215 + 0x00, 0x00, 0xF8, 0x03, 0x00, 0x02, 0xF8, 0x03, 0x00, 0x02, 0xF8, 0x03, // 216 + 0x00, 0x00, 0xF8, 0x03, 0x00, 0x02, 0xF8, 0x03, 0x00, 0x02, 0xF8, 0x03, 0x00, 0x06, // 217 + 0x00, 0x00, 0x08, 0x00, 0xF8, 0x03, 0x40, 0x02, 0x40, 0x02, 0x80, 0x01, // 218 + 0x00, 0x00, 0xF8, 0x03, 0x40, 0x02, 0x40, 0x02, 0x80, 0x01, 0xF8, 0x03, // 219 + 0x00, 0x00, 0xF8, 0x03, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x80, 0x01, // 220 + 0x00, 0x00, 0x10, 0x01, 0x08, 0x02, 0x48, 0x02, 0x48, 0x02, 0xF0, 0x01, // 221 + 0x00, 0x00, 0xF8, 0x03, 0x40, 0x00, 0xF0, 0x01, 0x08, 0x02, 0xF0, 0x01, // 222 + 0x00, 0x00, 0x30, 0x02, 0x48, 0x01, 0xC8, 0x00, 0x48, 0x00, 0xF8, 0x03, // 223 + 0x00, 0x00, 0x00, 0x01, 0xA0, 0x02, 0xA0, 0x02, 0xA0, 0x02, 0xC0, 0x03, // 224 + 0x00, 0x00, 0xE0, 0x01, 0x50, 0x02, 0x50, 0x02, 0x48, 0x02, 0x88, 0x01, // 225 + 0x00, 0x00, 0xE0, 0x03, 0xA0, 0x02, 0xA0, 0x02, 0xA0, 0x02, 0x40, 0x01, // 226 + 0x00, 0x00, 0xE0, 0x03, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x60, // 227 + 0x00, 0x00, 0x00, 0x02, 0xC0, 0x03, 0x20, 0x02, 0xE0, 0x03, 0x00, 0x02, // 228 + 0x00, 0x00, 0xC0, 0x01, 0xA0, 0x02, 0xA0, 0x02, 0xA0, 0x02, 0xC0, // 229 + 0x00, 0x00, 0x60, 0x03, 0x80, 0x00, 0xE0, 0x03, 0x80, 0x00, 0x60, 0x03, // 230 + 0x00, 0x00, 0x20, 0x02, 0xA0, 0x02, 0xA0, 0x02, 0xA0, 0x02, 0x40, 0x01, // 231 + 0x00, 0x00, 0xE0, 0x03, 0x00, 0x01, 0x80, 0x00, 0x40, 0x00, 0xE0, 0x03, // 232 + 0x00, 0x00, 0xE0, 0x03, 0x00, 0x01, 0x98, 0x00, 0x40, 0x00, 0xE0, 0x03, // 233 + 0x00, 0x00, 0xE0, 0x03, 0x80, 0x00, 0x80, 0x00, 0x40, 0x01, 0x20, 0x02, // 234 + 0x00, 0x00, 0x00, 0x02, 0xC0, 0x01, 0x20, 0x00, 0x20, 0x00, 0xE0, 0x03, // 235 + 0x00, 0x00, 0xE0, 0x03, 0x40, 0x00, 0x80, 0x00, 0x40, 0x00, 0xE0, 0x03, // 236 + 0x00, 0x00, 0xE0, 0x03, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0xE0, 0x03, // 237 + 0x00, 0x00, 0xC0, 0x01, 0x20, 0x02, 0x20, 0x02, 0x20, 0x02, 0xC0, 0x01, // 238 + 0x00, 0x00, 0xE0, 0x03, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0xE0, 0x03, // 239 + 0x00, 0x00, 0xE0, 0x03, 0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0x40, // 240 + 0x00, 0x00, 0xC0, 0x01, 0x20, 0x02, 0x20, 0x02, 0x20, 0x02, 0x40, 0x02, // 241 + 0x00, 0x00, 0x20, 0x00, 0x20, 0x00, 0xE0, 0x03, 0x20, 0x00, 0x20, // 242 + 0x00, 0x00, 0x60, 0x00, 0x80, 0x02, 0x80, 0x02, 0x80, 0x02, 0xE0, 0x01, // 243 + 0x00, 0x00, 0xC0, 0x00, 0x20, 0x01, 0xE0, 0x03, 0x20, 0x01, 0xC0, // 244 + 0x00, 0x00, 0x20, 0x02, 0x40, 0x01, 0x80, 0x00, 0x40, 0x01, 0x20, 0x02, // 245 + 0x00, 0x00, 0xE0, 0x03, 0x00, 0x02, 0x00, 0x02, 0xE0, 0x03, 0x00, 0x02, // 246 + 0x00, 0x00, 0x60, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0xE0, 0x03, // 247 + 0x00, 0x00, 0xE0, 0x03, 0x00, 0x02, 0xE0, 0x03, 0x00, 0x02, 0xE0, 0x03, // 248 + 0x00, 0x00, 0xE0, 0x03, 0x00, 0x02, 0xE0, 0x03, 0x00, 0x02, 0xE0, 0x03, 0x00, 0x06, // 249 + 0x00, 0x00, 0x20, 0x00, 0xE0, 0x03, 0x80, 0x02, 0x80, 0x02, 0x00, 0x01, // 250 + 0x00, 0x00, 0xE0, 0x03, 0x80, 0x02, 0x80, 0x02, 0x00, 0x01, 0xE0, 0x03, // 251 + 0x00, 0x00, 0xE0, 0x03, 0x80, 0x02, 0x80, 0x02, 0x80, 0x02, 0x00, 0x01, // 252 + 0x00, 0x00, 0x40, 0x01, 0x20, 0x02, 0xA0, 0x02, 0xA0, 0x02, 0xC0, 0x01, // 253 + 0x00, 0x00, 0xE0, 0x03, 0x80, 0x00, 0xC0, 0x01, 0x20, 0x02, 0xC0, 0x01, // 254 + 0x00, 0x00, 0x40, 0x02, 0xA0, 0x01, 0xA0, 0x00, 0xA0, 0x00, 0xE0, 0x03, // 255 }; \ No newline at end of file From 2472d0947ff4d8dd6c1e114cb73aed7f2531b490 Mon Sep 17 00:00:00 2001 From: GUVWAF <78759985+GUVWAF@users.noreply.github.com> Date: Mon, 20 Feb 2023 21:11:54 +0100 Subject: [PATCH 18/56] RadioLib's startChannel returns LORA_DETECTED for SX126x and SX128x (#2293) --- src/mesh/SX126xInterface.cpp | 2 +- src/mesh/SX128xInterface.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesh/SX126xInterface.cpp b/src/mesh/SX126xInterface.cpp index 8cd735da5..1036042eb 100644 --- a/src/mesh/SX126xInterface.cpp +++ b/src/mesh/SX126xInterface.cpp @@ -232,7 +232,7 @@ template bool SX126xInterface::isChannelActive() setStandby(); result = lora.scanChannel(); - if (result == RADIOLIB_PREAMBLE_DETECTED) + if (result == RADIOLIB_LORA_DETECTED) return true; assert(result != RADIOLIB_ERR_WRONG_MODEM); diff --git a/src/mesh/SX128xInterface.cpp b/src/mesh/SX128xInterface.cpp index c984d9f05..19001a0de 100644 --- a/src/mesh/SX128xInterface.cpp +++ b/src/mesh/SX128xInterface.cpp @@ -222,7 +222,7 @@ template bool SX128xInterface::isChannelActive() setStandby(); result = lora.scanChannel(); - if (result == RADIOLIB_PREAMBLE_DETECTED) + if (result == RADIOLIB_LORA_DETECTED) return true; assert(result != RADIOLIB_ERR_WRONG_MODEM); From 9b4a59f92d37a83725f4fbc28472fc8f28aacdd7 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Mon, 20 Feb 2023 16:23:02 -0600 Subject: [PATCH 19/56] Add da explora --- .github/workflows/main_matrix.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index 9b5baafdb..df5623fef 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -73,6 +73,8 @@ jobs: - board: m5stack-coreink - board: tbeam-s3-core - board: tlora-t3s3-v1 + - board: nano-g1 + - board: nano-g1-explorer uses: ./.github/workflows/build_esp32.yml with: board: ${{ matrix.board }} From 63005a94fd1fd816b0f870dd31dde2babe76d46a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 21 Feb 2023 06:23:02 -0600 Subject: [PATCH 20/56] [create-pull-request] automated change (#2294) Co-authored-by: thebentern Co-authored-by: Ben Meadors --- version.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.properties b/version.properties index bdda0d97b..d0805fbbf 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 0 -build = 21 +build = 22 From c8399b7256c02a3f9ee72d978e9d5a79516ee7ce Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Tue, 21 Feb 2023 07:18:08 -0600 Subject: [PATCH 21/56] Remove extra --- .github/workflows/main_matrix.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index df5623fef..13c32d783 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -73,7 +73,6 @@ jobs: - board: m5stack-coreink - board: tbeam-s3-core - board: tlora-t3s3-v1 - - board: nano-g1 - board: nano-g1-explorer uses: ./.github/workflows/build_esp32.yml with: From f1c457f0c34180a4e134b91557307f10cfd8157c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Tue, 21 Feb 2023 14:53:27 +0100 Subject: [PATCH 22/56] tryfix #2228 as suggested by @mverch67 --- src/mesh/ReliableRouter.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mesh/ReliableRouter.cpp b/src/mesh/ReliableRouter.cpp index 8000926f3..c973fd0c2 100644 --- a/src/mesh/ReliableRouter.cpp +++ b/src/mesh/ReliableRouter.cpp @@ -148,7 +148,10 @@ bool ReliableRouter::stopRetransmission(GlobalPacketId key) if (old) { auto numErased = pending.erase(key); assert(numErased == 1); + // remove the 'original' (identified by originator and packet->id) from the txqueue and free it cancelSending(getFrom(old->packet), old->packet->id); + // now free the pooled copy for retransmission too. tryfix for #2228 + packetPool.release(old->packet); return true; } else return false; From 568899031d594a21f7c60026953bf1958131ba0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Tue, 21 Feb 2023 20:01:56 +0100 Subject: [PATCH 23/56] Check if there's something there before we free it --- src/mesh/ReliableRouter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesh/ReliableRouter.cpp b/src/mesh/ReliableRouter.cpp index c973fd0c2..3d07ff77e 100644 --- a/src/mesh/ReliableRouter.cpp +++ b/src/mesh/ReliableRouter.cpp @@ -151,7 +151,8 @@ bool ReliableRouter::stopRetransmission(GlobalPacketId key) // remove the 'original' (identified by originator and packet->id) from the txqueue and free it cancelSending(getFrom(old->packet), old->packet->id); // now free the pooled copy for retransmission too. tryfix for #2228 - packetPool.release(old->packet); + if (old->packet) + packetPool.release(old->packet); return true; } else return false; From 57fc9baafc65071bd18bedebcc6c99222958c2b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Fri, 10 Mar 2023 21:39:21 +0100 Subject: [PATCH 24/56] cmsis is donning his own HardFault Handler --- src/platform/nrf52/hardfault.cpp | 2 +- variants/portduino/platformio.ini | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/platform/nrf52/hardfault.cpp b/src/platform/nrf52/hardfault.cpp index 13a4ee046..7b7a718b8 100644 --- a/src/platform/nrf52/hardfault.cpp +++ b/src/platform/nrf52/hardfault.cpp @@ -90,7 +90,7 @@ extern "C" void HardFault_Handler(void) asm volatile(" mrs r0,msp\n" " b HardFault_Impl \n"); } -#else +#elif !defined(ARCH_NRF52) /* The prototype shows it is a naked function - in effect this is just an assembly function. */ diff --git a/variants/portduino/platformio.ini b/variants/portduino/platformio.ini index 99e9667b6..5bbde2adf 100644 --- a/variants/portduino/platformio.ini +++ b/variants/portduino/platformio.ini @@ -2,7 +2,6 @@ extends = portduino_base build_flags = ${portduino_base.build_flags} -O0 -I variants/portduino board = cross_platform -board_level = extra lib_deps = ${portduino_base.lib_deps} build_src_filter = ${portduino_base.build_src_filter} @@ -11,7 +10,6 @@ build_src_filter = ${portduino_base.build_src_filter} extends = portduino_base build_flags = ${portduino_base.build_flags} -O0 -lgpiod -I variants/portduino board = linux_hardware -board_level = extra lib_deps = ${portduino_base.lib_deps} build_src_filter = ${portduino_base.build_src_filter} @@ -20,6 +18,5 @@ build_src_filter = ${portduino_base.build_src_filter} extends = portduino_base build_flags = ${portduino_base.build_flags} -O0 -lgpiod -I variants/portduino board = linux_arm -board_level = extra lib_deps = ${portduino_base.lib_deps} build_src_filter = ${portduino_base.build_src_filter} From 990d418dc8f1b9801ae0414bdf1622d774dc4c4b Mon Sep 17 00:00:00 2001 From: ghostop14 Date: Tue, 4 Apr 2023 09:14:47 -0400 Subject: [PATCH 25/56] Add MQTT TLS Support for WIFI-Enabled Devices (#2410) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Testing TLS MQTT Support * Working TLS connections * Testing TLS MQTT Support * Working TLS connections * Added protobuf support for mqtt.tls_enabled * fix 'em up good * don't commit this stuff, jeeez * there i fixed it --------- Co-authored-by: Ben Meadors Co-authored-by: Thomas Göttgens --- src/mqtt/MQTT.cpp | 22 +++++++++++++++++++++- src/mqtt/MQTT.h | 9 +++++++-- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/mqtt/MQTT.cpp b/src/mqtt/MQTT.cpp index 56bdf300f..260a70c3f 100644 --- a/src/mqtt/MQTT.cpp +++ b/src/mqtt/MQTT.cpp @@ -192,6 +192,26 @@ void MQTT::reconnect() mqttPassword = moduleConfig.mqtt.password; } +#if HAS_WIFI && !defined(ARCH_PORTDUINO) + if (moduleConfig.mqtt.tls_enabled) { + // change default for encrypted to 8883 + try { + serverPort = 8883; + wifiSecureClient.setInsecure(); + + pubSub.setClient(wifiSecureClient); + LOG_INFO("Using TLS-encrypted session\n"); + } catch (const std::exception &e) { + LOG_ERROR("MQTT ERROR: %s\n", e.what()); + } + } else { + LOG_INFO("Using non-TLS-encrypted session\n"); + pubSub.setClient(mqttClient); + } +#else + pubSub.setClient(mqttClient); +#endif + String server = String(serverAddr); int delimIndex = server.indexOf(':'); if (delimIndex > 0) { @@ -528,4 +548,4 @@ std::string MQTT::downstreamPacketToJson(meshtastic_MeshPacket *mp) delete value; return jsonStr; -} +} \ No newline at end of file diff --git a/src/mqtt/MQTT.h b/src/mqtt/MQTT.h index 2b38868be..3065cc08e 100644 --- a/src/mqtt/MQTT.h +++ b/src/mqtt/MQTT.h @@ -8,6 +8,9 @@ #include #if HAS_WIFI #include +#if !defined(ARCH_PORTDUINO) +#include +#endif #endif #if HAS_ETHERNET #include @@ -23,9 +26,11 @@ class MQTT : private concurrency::OSThread { // supposedly the current version is busted: // http://www.iotsharing.com/2017/08/how-to-use-esp32-mqtts-with-mqtts-mosquitto-broker-tls-ssl.html - // WiFiClientSecure wifiClient; #if HAS_WIFI WiFiClient mqttClient; +#if !defined(ARCH_PORTDUINO) + WiFiClientSecure wifiSecureClient; +#endif #endif #if HAS_ETHERNET EthernetClient mqttClient; @@ -87,4 +92,4 @@ class MQTT : private concurrency::OSThread void mqttInit(); -extern MQTT *mqtt; +extern MQTT *mqtt; \ No newline at end of file From de083602718d683d26718e46d0557d718974b14f Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Tue, 4 Apr 2023 08:15:59 -0500 Subject: [PATCH 26/56] Protos tag for release --- protobufs | 2 +- src/mesh/generated/meshtastic/channel.pb.h | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/protobufs b/protobufs index 641d7c3a4..3e5ab67ff 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 641d7c3a460de9cc580bc2b8a0812e8b9d417b05 +Subproject commit 3e5ab67ff6659476df66bde6bbbae3c520460db9 diff --git a/src/mesh/generated/meshtastic/channel.pb.h b/src/mesh/generated/meshtastic/channel.pb.h index 83ef7b5fc..535962ae6 100644 --- a/src/mesh/generated/meshtastic/channel.pb.h +++ b/src/mesh/generated/meshtastic/channel.pb.h @@ -31,11 +31,9 @@ typedef enum _meshtastic_Channel_Role { /* Struct definitions */ typedef PB_BYTES_ARRAY_T(32) meshtastic_ChannelSettings_psk_t; -/* Full settings (center freq, spread factor, pre-shared secret key etc...) - needed to configure a radio for speaking on a particular channel This - information can be encoded as a QRcode/url so that other users can configure +/* This information can be encoded as a QRcode/url so that other users can configure their radio to join the same channel. - A note about how channel names are shown to users: channelname-Xy + A note about how channel names are shown to users: channelname-X poundsymbol is a prefix used to indicate this is a channel name (idea from @professr). Where X is a letter from A-Z (base 26) representing a hash of the PSK for this channel - so that if the user changes anything about the channel (which does @@ -45,8 +43,6 @@ typedef PB_BYTES_ARRAY_T(32) meshtastic_ChannelSettings_psk_t; The PSK is hashed into this letter by "0x41 + [xor all bytes of the psk ] modulo 26" This also allows the option of someday if people have the PSK off (zero), the users COULD type in a channel name and be able to talk. - Y is a lower case letter from a-z that represents the channel 'speed' settings - (for some future definition of speed) FIXME: Add description of multi-channel support and how primary vs secondary channels are used. FIXME: explain how apps use channels for security. explain how remote settings and remote gpio are managed as an example */ @@ -60,7 +56,7 @@ typedef struct _meshtastic_ChannelSettings { because they are listed in this source code. Those bytes are mapped using the following scheme: `0` = No crypto - `1` = The special "default" channel key: {0xd4, 0xf1, 0xbb, 0x3a, 0x20, 0x29, 0x07, 0x59, 0xf0, 0xbc, 0xff, 0xab, 0xcf, 0x4e, 0x69, 0xbf} + `1` = The special "default" channel key: {0xd4, 0xf1, 0xbb, 0x3a, 0x20, 0x29, 0x07, 0x59, 0xf0, 0xbc, 0xff, 0xab, 0xcf, 0x4e, 0x69, 0x01} `2` through 10 = The default channel key, except with 1 through 9 added to the last byte. Shown to user as simple1 through 10 */ meshtastic_ChannelSettings_psk_t psk; From 242f880764a6217cecf4c48fe8bd7d87132077d5 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Tue, 4 Apr 2023 09:42:12 -0500 Subject: [PATCH 27/56] Dear trunk, please don't be petty --- .github/workflows/main_matrix.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index ccc7c4ca8..a6fb39b29 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -42,6 +42,7 @@ jobs: uses: ./.github/actions/setup-base - name: Trunk Check + if: ${{ github.event_name != 'workflow_dispatch' }} uses: trunk-io/trunk-action@v1 - name: Check ${{ matrix.board }} From aa96ea02c6ad7724fe894b0d14e2be1bf1c4c0c7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 4 Apr 2023 14:13:26 -0500 Subject: [PATCH 28/56] [create-pull-request] automated change (#2411) Co-authored-by: thebentern --- version.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.properties b/version.properties index b26a5f4c0..909888740 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 1 -build = 7 +build = 8 From 82ab38d3e6cb2bfeef280ee5529645c5ffcab159 Mon Sep 17 00:00:00 2001 From: Manuel Verch Date: Tue, 4 Apr 2023 22:13:13 +0200 Subject: [PATCH 29/56] Revert changes on wakeup --- src/PowerFSM.cpp | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/PowerFSM.cpp b/src/PowerFSM.cpp index 2139d9d8f..e6ebdcc93 100644 --- a/src/PowerFSM.cpp +++ b/src/PowerFSM.cpp @@ -93,18 +93,23 @@ static void lsIdle() powerFSM.trigger(EVENT_SERIAL_CONNECTED); break; - case ESP_SLEEP_WAKEUP_GPIO: - // GPIO of BUTTON_PIN (if available) triggered the wakeup - powerFSM.trigger(EVENT_PRESS); - break; - default: - // We woke for some other reason (device interrupt) + // We woke for some other reason (button press, device interrupt) // uint64_t status = esp_sleep_get_ext1_wakeup_status(); LOG_INFO("wakeCause2 %d\n", wakeCause2); - // Let the NB state handle the IRQ (and that state will handle stuff like IRQs etc) - // we lie and say "wake timer" because the interrupt will be handled by the regular IRQ code - powerFSM.trigger(EVENT_WAKE_TIMER); + +#ifdef BUTTON_PIN + bool pressed = !digitalRead(BUTTON_PIN); +#else + bool pressed = false; +#endif + if (pressed) { // If we woke because of press, instead generate a PRESS event. + powerFSM.trigger(EVENT_PRESS); + } else { + // Otherwise let the NB state handle the IRQ (and that state will handle stuff like IRQs etc) + // we lie and say "wake timer" because the interrupt will be handled by the regular IRQ code + powerFSM.trigger(EVENT_WAKE_TIMER); + } break; } } else { @@ -348,4 +353,4 @@ void PowerFSM_setup() #endif powerFSM.run_machine(); // run one interation of the state machine, so we run our on enter tasks for the initial DARK state -} +} \ No newline at end of file From d4e42898b1e3a5ca129ea4dfe46a2df2161aa3aa Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 7 Apr 2023 07:14:40 -0500 Subject: [PATCH 30/56] [create-pull-request] automated change (#2417) Co-authored-by: thebentern --- protobufs | 2 +- src/mesh/generated/meshtastic/deviceonly.pb.h | 2 +- src/mesh/generated/meshtastic/localonly.pb.h | 2 +- src/mesh/generated/meshtastic/module_config.pb.h | 15 ++++++++++----- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/protobufs b/protobufs index 3e5ab67ff..5f00ad569 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 3e5ab67ff6659476df66bde6bbbae3c520460db9 +Subproject commit 5f00ad5691ae7d8a03fd92437b81e9a424e3483f diff --git a/src/mesh/generated/meshtastic/deviceonly.pb.h b/src/mesh/generated/meshtastic/deviceonly.pb.h index 6788bd426..56beee95e 100644 --- a/src/mesh/generated/meshtastic/deviceonly.pb.h +++ b/src/mesh/generated/meshtastic/deviceonly.pb.h @@ -188,7 +188,7 @@ extern const pb_msgdesc_t meshtastic_OEMStore_msg; /* Maximum encoded size of messages (where known) */ #define meshtastic_ChannelFile_size 638 #define meshtastic_DeviceState_size 22040 -#define meshtastic_OEMStore_size 3024 +#define meshtastic_OEMStore_size 3041 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/mesh/generated/meshtastic/localonly.pb.h b/src/mesh/generated/meshtastic/localonly.pb.h index 23865f47d..0cfcb2491 100644 --- a/src/mesh/generated/meshtastic/localonly.pb.h +++ b/src/mesh/generated/meshtastic/localonly.pb.h @@ -157,7 +157,7 @@ extern const pb_msgdesc_t meshtastic_LocalModuleConfig_msg; /* Maximum encoded size of messages (where known) */ #define meshtastic_LocalConfig_size 456 -#define meshtastic_LocalModuleConfig_size 422 +#define meshtastic_LocalModuleConfig_size 439 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/mesh/generated/meshtastic/module_config.pb.h b/src/mesh/generated/meshtastic/module_config.pb.h index f94114e15..e59d33dd0 100644 --- a/src/mesh/generated/meshtastic/module_config.pb.h +++ b/src/mesh/generated/meshtastic/module_config.pb.h @@ -98,6 +98,9 @@ typedef struct _meshtastic_ModuleConfig_MQTTConfig { bool json_enabled; /* If true, we attempt to establish a secure connection using TLS */ bool tls_enabled; + /* The root topic to use for MQTT messages. Default is "msh". + This is useful if you want to use a single MQTT server for multiple meshtastic networks and separate them via ACLs */ + char root[16]; } meshtastic_ModuleConfig_MQTTConfig; /* RemoteHardwareModule Config */ @@ -325,7 +328,7 @@ extern "C" { /* Initializer values for message structs */ #define meshtastic_ModuleConfig_init_default {0, {meshtastic_ModuleConfig_MQTTConfig_init_default}} -#define meshtastic_ModuleConfig_MQTTConfig_init_default {0, "", "", "", 0, 0, 0} +#define meshtastic_ModuleConfig_MQTTConfig_init_default {0, "", "", "", 0, 0, 0, ""} #define meshtastic_ModuleConfig_RemoteHardwareConfig_init_default {0} #define meshtastic_ModuleConfig_AudioConfig_init_default {0, 0, _meshtastic_ModuleConfig_AudioConfig_Audio_Baud_MIN, 0, 0, 0, 0} #define meshtastic_ModuleConfig_SerialConfig_init_default {0, 0, 0, 0, _meshtastic_ModuleConfig_SerialConfig_Serial_Baud_MIN, 0, _meshtastic_ModuleConfig_SerialConfig_Serial_Mode_MIN} @@ -335,7 +338,7 @@ extern "C" { #define meshtastic_ModuleConfig_TelemetryConfig_init_default {0, 0, 0, 0, 0, 0, 0} #define meshtastic_ModuleConfig_CannedMessageConfig_init_default {0, 0, 0, 0, _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MIN, _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MIN, _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MIN, 0, 0, "", 0} #define meshtastic_ModuleConfig_init_zero {0, {meshtastic_ModuleConfig_MQTTConfig_init_zero}} -#define meshtastic_ModuleConfig_MQTTConfig_init_zero {0, "", "", "", 0, 0, 0} +#define meshtastic_ModuleConfig_MQTTConfig_init_zero {0, "", "", "", 0, 0, 0, ""} #define meshtastic_ModuleConfig_RemoteHardwareConfig_init_zero {0} #define meshtastic_ModuleConfig_AudioConfig_init_zero {0, 0, _meshtastic_ModuleConfig_AudioConfig_Audio_Baud_MIN, 0, 0, 0, 0} #define meshtastic_ModuleConfig_SerialConfig_init_zero {0, 0, 0, 0, _meshtastic_ModuleConfig_SerialConfig_Serial_Baud_MIN, 0, _meshtastic_ModuleConfig_SerialConfig_Serial_Mode_MIN} @@ -353,6 +356,7 @@ extern "C" { #define meshtastic_ModuleConfig_MQTTConfig_encryption_enabled_tag 5 #define meshtastic_ModuleConfig_MQTTConfig_json_enabled_tag 6 #define meshtastic_ModuleConfig_MQTTConfig_tls_enabled_tag 7 +#define meshtastic_ModuleConfig_MQTTConfig_root_tag 8 #define meshtastic_ModuleConfig_RemoteHardwareConfig_enabled_tag 1 #define meshtastic_ModuleConfig_AudioConfig_codec2_enabled_tag 1 #define meshtastic_ModuleConfig_AudioConfig_ptt_pin_tag 2 @@ -448,7 +452,8 @@ X(a, STATIC, SINGULAR, STRING, username, 3) \ X(a, STATIC, SINGULAR, STRING, password, 4) \ X(a, STATIC, SINGULAR, BOOL, encryption_enabled, 5) \ X(a, STATIC, SINGULAR, BOOL, json_enabled, 6) \ -X(a, STATIC, SINGULAR, BOOL, tls_enabled, 7) +X(a, STATIC, SINGULAR, BOOL, tls_enabled, 7) \ +X(a, STATIC, SINGULAR, STRING, root, 8) #define meshtastic_ModuleConfig_MQTTConfig_CALLBACK NULL #define meshtastic_ModuleConfig_MQTTConfig_DEFAULT NULL @@ -566,13 +571,13 @@ extern const pb_msgdesc_t meshtastic_ModuleConfig_CannedMessageConfig_msg; #define meshtastic_ModuleConfig_AudioConfig_size 19 #define meshtastic_ModuleConfig_CannedMessageConfig_size 49 #define meshtastic_ModuleConfig_ExternalNotificationConfig_size 40 -#define meshtastic_ModuleConfig_MQTTConfig_size 203 +#define meshtastic_ModuleConfig_MQTTConfig_size 220 #define meshtastic_ModuleConfig_RangeTestConfig_size 10 #define meshtastic_ModuleConfig_RemoteHardwareConfig_size 2 #define meshtastic_ModuleConfig_SerialConfig_size 26 #define meshtastic_ModuleConfig_StoreForwardConfig_size 22 #define meshtastic_ModuleConfig_TelemetryConfig_size 26 -#define meshtastic_ModuleConfig_size 206 +#define meshtastic_ModuleConfig_size 223 #ifdef __cplusplus } /* extern "C" */ From 43cff7adc9497a551390e1913f247312470ea3b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Fri, 7 Apr 2023 14:52:23 +0200 Subject: [PATCH 31/56] Implement #2380 (#2418) --- bin/regen-protos.bat | 6 +----- src/mqtt/MQTT.cpp | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/bin/regen-protos.bat b/bin/regen-protos.bat index aa2a2684f..1422f7914 100644 --- a/bin/regen-protos.bat +++ b/bin/regen-protos.bat @@ -1,5 +1 @@ -cd protobufs && ..\nanopb-0.4.7\generator-bin\protoc.exe --nanopb_out=-v:..\src\mesh\generated -I=..\protobufs ..\protobufs\meshtastic\*.proto - -@REM cd ../src/mesh/generated/meshtastic -@REM sed -i 's/#include "meshtastic/#include "./g' * -@REM sed -i 's/meshtastic_//g' * +cd protobufs && ..\nanopb-0.4.7\generator-bin\protoc.exe --experimental_allow_proto3_optional --nanopb_out=-v:..\src\mesh\generated -I=..\protobufs ..\protobufs\meshtastic\*.proto diff --git a/src/mqtt/MQTT.cpp b/src/mqtt/MQTT.cpp index 260a70c3f..c0758019a 100644 --- a/src/mqtt/MQTT.cpp +++ b/src/mqtt/MQTT.cpp @@ -19,9 +19,9 @@ const int reconnectMax = 5; MQTT *mqtt; -std::string statusTopic = "msh/2/stat/"; -std::string cryptTopic = "msh/2/c/"; // msh/2/c/CHANNELID/NODEID -std::string jsonTopic = "msh/2/json/"; // msh/2/json/CHANNELID/NODEID +std::string statusTopic = "/2/stat/"; +std::string cryptTopic = "/2/c/"; // msh/2/c/CHANNELID/NODEID +std::string jsonTopic = "/2/json/"; // msh/2/json/CHANNELID/NODEID static MemoryDynamic staticMqttPool; @@ -164,6 +164,16 @@ MQTT::MQTT() : concurrency::OSThread("mqtt"), pubSub(mqttClient), mqttQueue(MAX_ assert(!mqtt); mqtt = this; + if (moduleConfig.mqtt.root) { + statusTopic = moduleConfig.mqtt.root + statusTopic; + cryptTopic = moduleConfig.mqtt.root + cryptTopic; + jsonTopic = moduleConfig.mqtt.root + jsonTopic; + } else { + statusTopic = "msh" + statusTopic; + cryptTopic = "msh" + cryptTopic; + jsonTopic = "msh" + jsonTopic; + } + pubSub.setCallback(mqttCallback); // preflightSleepObserver.observe(&preflightSleep); From 320bf5768753e5423dd607e0792a6e99a3d31c46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Fri, 7 Apr 2023 15:05:19 +0200 Subject: [PATCH 32/56] tryfix #2416 - lock some guards. --- src/mesh/CryptoEngine.cpp | 2 ++ src/mesh/CryptoEngine.h | 3 +++ src/mesh/Router.cpp | 8 ++++++++ 3 files changed, 13 insertions(+) diff --git a/src/mesh/CryptoEngine.cpp b/src/mesh/CryptoEngine.cpp index 9b5810650..1e44cb9b7 100644 --- a/src/mesh/CryptoEngine.cpp +++ b/src/mesh/CryptoEngine.cpp @@ -1,6 +1,8 @@ #include "CryptoEngine.h" #include "configuration.h" +concurrency::Lock *cryptLock; + void CryptoEngine::setKey(const CryptoKey &k) { LOG_DEBUG("Using AES%d key!\n", k.length * 8); diff --git a/src/mesh/CryptoEngine.h b/src/mesh/CryptoEngine.h index 1dda7ce31..2737dab2d 100644 --- a/src/mesh/CryptoEngine.h +++ b/src/mesh/CryptoEngine.h @@ -1,7 +1,10 @@ #pragma once +#include "concurrency/LockGuard.h" #include +extern concurrency::Lock *cryptLock; + struct CryptoKey { uint8_t bytes[32]; diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index b3aee4e7d..e85d85450 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -55,6 +55,10 @@ Router::Router() : concurrency::OSThread("Router"), fromRadioQueue(MAX_RX_FROMRA LOG_DEBUG("Size of MeshPacket %d\n", sizeof(MeshPacket)); */ fromRadioQueue.setReader(this); + + // init Lockguard for crypt operations + assert(!cryptLock); + cryptLock = new concurrency::Lock(); } /** @@ -305,6 +309,8 @@ void Router::sniffReceived(const meshtastic_MeshPacket *p, const meshtastic_Rout bool perhapsDecode(meshtastic_MeshPacket *p) { + concurrency::LockGuard g(cryptLock); + if (config.device.role == meshtastic_Config_DeviceConfig_Role_REPEATER && config.device.rebroadcast_mode == meshtastic_Config_DeviceConfig_RebroadcastMode_ALL_SKIP_DECODING) return false; @@ -371,6 +377,8 @@ bool perhapsDecode(meshtastic_MeshPacket *p) */ meshtastic_Routing_Error perhapsEncode(meshtastic_MeshPacket *p) { + concurrency::LockGuard g(cryptLock); + // If the packet is not yet encrypted, do so now if (p->which_payload_variant == meshtastic_MeshPacket_decoded_tag) { size_t numbytes = pb_encode_to_bytes(bytes, sizeof(bytes), &meshtastic_Data_msg, &p->decoded); From f0c4c18a7979fa9f339b9f5c707a3eab769c46d3 Mon Sep 17 00:00:00 2001 From: Manuel Verch Date: Tue, 11 Apr 2023 13:16:19 +0200 Subject: [PATCH 33/56] Fix for nodeInfo change to inform phone --- src/mesh/NodeDB.cpp | 6 ++++-- src/mesh/NodeDB.h | 2 +- src/modules/NodeInfoModule.cpp | 6 +++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index c7a42cb09..02749feb8 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -689,11 +689,11 @@ void NodeDB::updateTelemetry(uint32_t nodeId, const meshtastic_Telemetry &t, RxS /** Update user info for this node based on received user data */ -void NodeDB::updateUser(uint32_t nodeId, const meshtastic_User &p) +bool NodeDB::updateUser(uint32_t nodeId, const meshtastic_User &p) { meshtastic_NodeInfo *info = getOrCreateNode(nodeId); if (!info) { - return; + return false; } LOG_DEBUG("old user %s/%s/%s\n", info->user.id, info->user.long_name, info->user.short_name); @@ -713,6 +713,8 @@ void NodeDB::updateUser(uint32_t nodeId, const meshtastic_User &p) // We just changed something important about the user, store our DB saveToDisk(SEGMENT_DEVICESTATE); } + + return changed; } /// given a subpacket sniffed from the network, update our DB state diff --git a/src/mesh/NodeDB.h b/src/mesh/NodeDB.h index 2822ffbf6..541b51f83 100644 --- a/src/mesh/NodeDB.h +++ b/src/mesh/NodeDB.h @@ -86,7 +86,7 @@ class NodeDB /** Update user info for this node based on received user data */ - void updateUser(uint32_t nodeId, const meshtastic_User &p); + bool updateUser(uint32_t nodeId, const meshtastic_User &p); /// @return our node number NodeNum getNodeNum() { return myNodeInfo.my_node_num; } diff --git a/src/modules/NodeInfoModule.cpp b/src/modules/NodeInfoModule.cpp index cf8c17c3b..09819dab1 100644 --- a/src/modules/NodeInfoModule.cpp +++ b/src/modules/NodeInfoModule.cpp @@ -12,7 +12,7 @@ bool NodeInfoModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, mes { auto p = *pptr; - nodeDB.updateUser(getFrom(&mp), p); + bool hasChanged = nodeDB.updateUser(getFrom(&mp), p); bool wasBroadcast = mp.to == NODENUM_BROADCAST; @@ -23,6 +23,10 @@ bool NodeInfoModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, mes screen->print(lcd.c_str()); } + // if user has changed while packet was not for us, inform phone + if (hasChanged && !wasBroadcast && mp.to != nodeDB.getNodeNum()) + service.sendToPhone(packetPool.allocCopy(mp)); + // LOG_DEBUG("did handleReceived\n"); return false; // Let others look at this message also if they want } From 29c13b5c3010eab695aaf608aef98cf7e4ecc35f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Tue, 11 Apr 2023 12:36:44 +0200 Subject: [PATCH 34/56] resolve #2364 - fix wrong debug print - change shutdown logic for t-beam if PMU is detected - wait for 10 seconds instead of 5 for shutdown and resurrect screen brightness adjust for @karamo --- src/ButtonThread.h | 14 ++++++-------- src/Power.cpp | 7 +++---- src/sleep.cpp | 6 +++++- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/ButtonThread.h b/src/ButtonThread.h index f35c53a46..9d7fd2ae5 100644 --- a/src/ButtonThread.h +++ b/src/ButtonThread.h @@ -123,14 +123,12 @@ class ButtonThread : public concurrency::OSThread static void userButtonPressedLong() { // LOG_DEBUG("Long press!\n"); - // If user button is held down for 5 seconds, shutdown the device. - if ((millis() - longPressTime > 5 * 1000) && (longPressTime > 0)) { -#ifdef HAS_PMU - if (pmu_found == true) { - setLed(false); - power->shutdown(); - } -#elif defined(ARCH_NRF52) || defined(ARCH_ESP32) + if (screen_found == true) { + screen->adjustBrightness(); + } + // If user button is held down for 10 seconds, shutdown the device. + if ((millis() - longPressTime > 10000) && (longPressTime > 0)) { +#if defined(ARCH_NRF52) || defined(ARCH_ESP32) // Do actual shutdown when button released, otherwise the button release // may wake the board immediatedly. if ((!shutdown_on_long_stop) && (millis() > 30 * 1000)) { diff --git a/src/Power.cpp b/src/Power.cpp index 6c4851c11..6b5bebe4d 100644 --- a/src/Power.cpp +++ b/src/Power.cpp @@ -277,12 +277,11 @@ void Power::shutdown() LOG_INFO("Shutting down\n"); #ifdef HAS_PMU - if (PMU) { + if (pmu_found == true) { PMU->setChargingLedMode(XPOWERS_CHG_LED_OFF); + PMU->shutdown(); } -#endif - -#if defined(ARCH_NRF52) || defined(ARCH_ESP32) +#elif defined(ARCH_NRF52) || defined(ARCH_ESP32) #ifdef PIN_LED1 ledOff(PIN_LED1); #endif diff --git a/src/sleep.cpp b/src/sleep.cpp index e3f042a27..5fdacb73e 100644 --- a/src/sleep.cpp +++ b/src/sleep.cpp @@ -203,7 +203,11 @@ void doGPSpowersave(bool on) void doDeepSleep(uint64_t msecToWake) { - LOG_INFO("Entering deep sleep for %lu seconds\n", msecToWake / 1000); + if (INCLUDE_vTaskSuspend && (msecToWake == portMAX_DELAY)) { + LOG_INFO("Entering deep sleep forever\n"); + } else { + LOG_INFO("Entering deep sleep for %u seconds\n", msecToWake / 1000); + } // not using wifi yet, but once we are this is needed to shutoff the radio hw // esp_wifi_stop(); From a9eb19fc62e85fc369b07d1862814a765a2ff2fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Tue, 11 Apr 2023 13:32:19 +0200 Subject: [PATCH 35/56] fix parameters and compilation --- src/ButtonThread.h | 4 +--- src/platform/esp32/main-esp32.cpp | 2 +- src/platform/nrf52/main-nrf52.cpp | 2 +- src/platform/portduino/PortduinoGlue.cpp | 2 +- src/platform/rp2040/main-rp2040.cpp | 2 +- src/platform/stm32wl/main-stm32wl.cpp | 2 +- src/sleep.cpp | 2 +- src/sleep.h | 2 +- 8 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/ButtonThread.h b/src/ButtonThread.h index 9d7fd2ae5..b295f896a 100644 --- a/src/ButtonThread.h +++ b/src/ButtonThread.h @@ -123,9 +123,7 @@ class ButtonThread : public concurrency::OSThread static void userButtonPressedLong() { // LOG_DEBUG("Long press!\n"); - if (screen_found == true) { - screen->adjustBrightness(); - } + screen->adjustBrightness(); // If user button is held down for 10 seconds, shutdown the device. if ((millis() - longPressTime > 10000) && (longPressTime > 0)) { #if defined(ARCH_NRF52) || defined(ARCH_ESP32) diff --git a/src/platform/esp32/main-esp32.cpp b/src/platform/esp32/main-esp32.cpp index 645132f38..2068025c2 100644 --- a/src/platform/esp32/main-esp32.cpp +++ b/src/platform/esp32/main-esp32.cpp @@ -162,7 +162,7 @@ void esp32Loop() // radio.radioIf.canSleep(); } -void cpuDeepSleep(uint64_t msecToWake) +void cpuDeepSleep(uint32_t msecToWake) { /* Some ESP32 IOs have internal pullups or pulldowns, which are enabled by default. diff --git a/src/platform/nrf52/main-nrf52.cpp b/src/platform/nrf52/main-nrf52.cpp index 1cbe05631..36ddefeb4 100644 --- a/src/platform/nrf52/main-nrf52.cpp +++ b/src/platform/nrf52/main-nrf52.cpp @@ -155,7 +155,7 @@ void nrf52Setup() nRFCrypto.end(); } -void cpuDeepSleep(uint64_t msecToWake) +void cpuDeepSleep(uint32_t msecToWake) { // FIXME, configure RTC or button press to wake us // FIXME, power down SPI, I2C, RAMs diff --git a/src/platform/portduino/PortduinoGlue.cpp b/src/platform/portduino/PortduinoGlue.cpp index fee6e05f9..4e957cb1e 100644 --- a/src/platform/portduino/PortduinoGlue.cpp +++ b/src/platform/portduino/PortduinoGlue.cpp @@ -16,7 +16,7 @@ void setBluetoothEnable(bool on) // not needed } -void cpuDeepSleep(uint64_t msecs) +void cpuDeepSleep(uint32_t msecs) { notImplemented("cpuDeepSleep"); } diff --git a/src/platform/rp2040/main-rp2040.cpp b/src/platform/rp2040/main-rp2040.cpp index 1de8c5b68..af200f961 100644 --- a/src/platform/rp2040/main-rp2040.cpp +++ b/src/platform/rp2040/main-rp2040.cpp @@ -7,7 +7,7 @@ void setBluetoothEnable(bool on) // not needed } -void cpuDeepSleep(uint64_t msecs) +void cpuDeepSleep(uint32_t msecs) { // not needed } diff --git a/src/platform/stm32wl/main-stm32wl.cpp b/src/platform/stm32wl/main-stm32wl.cpp index 147408441..8ebcb029e 100644 --- a/src/platform/stm32wl/main-stm32wl.cpp +++ b/src/platform/stm32wl/main-stm32wl.cpp @@ -15,7 +15,7 @@ void getMacAddr(uint8_t *dmac) dmac[i] = i; } -void cpuDeepSleep(uint64_t msecToWake) {} +void cpuDeepSleep(uint32_t msecToWake) {} /* pacify libc_nano */ extern "C" { diff --git a/src/sleep.cpp b/src/sleep.cpp index 5fdacb73e..9d2b557ac 100644 --- a/src/sleep.cpp +++ b/src/sleep.cpp @@ -201,7 +201,7 @@ void doGPSpowersave(bool on) #endif } -void doDeepSleep(uint64_t msecToWake) +void doDeepSleep(uint32_t msecToWake) { if (INCLUDE_vTaskSuspend && (msecToWake == portMAX_DELAY)) { LOG_INFO("Entering deep sleep forever\n"); diff --git a/src/sleep.h b/src/sleep.h index af59a8dad..a4b8f37b5 100644 --- a/src/sleep.h +++ b/src/sleep.h @@ -4,7 +4,7 @@ #include "Observer.h" #include "configuration.h" -void doDeepSleep(uint64_t msecToWake), cpuDeepSleep(uint64_t msecToWake); +void doDeepSleep(uint32_t msecToWake), cpuDeepSleep(uint32_t msecToWake); #ifdef ARCH_ESP32 #include "esp_sleep.h" From f526c4cc5a01755709045f86678ada4c25c6eb19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Tue, 11 Apr 2023 13:45:18 +0200 Subject: [PATCH 36/56] trxfix portduino --- src/sleep.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sleep.cpp b/src/sleep.cpp index 9d2b557ac..650cb66d6 100644 --- a/src/sleep.cpp +++ b/src/sleep.cpp @@ -16,6 +16,10 @@ #include #include +#ifndef INCLUDE_vTaskSuspend +#define INCLUDE_vTaskSuspend 0 +#endif + esp_sleep_source_t wakeCause; // the reason we booted this time #endif From eeeb7c5080986f9a5d098063eb16953905a3e69f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Tue, 11 Apr 2023 13:50:03 +0200 Subject: [PATCH 37/56] i wasn't asking... --- src/sleep.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sleep.cpp b/src/sleep.cpp index 650cb66d6..9468b7d09 100644 --- a/src/sleep.cpp +++ b/src/sleep.cpp @@ -16,11 +16,11 @@ #include #include -#ifndef INCLUDE_vTaskSuspend -#define INCLUDE_vTaskSuspend 0 +esp_sleep_source_t wakeCause; // the reason we booted this time #endif -esp_sleep_source_t wakeCause; // the reason we booted this time +#ifndef INCLUDE_vTaskSuspend +#define INCLUDE_vTaskSuspend 0 #endif #ifdef HAS_PMU From ee971e376a397696a40496a4df45168fdb3a3878 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 11 Apr 2023 08:01:49 -0500 Subject: [PATCH 38/56] [create-pull-request] automated change (#2424) Co-authored-by: thebentern --- protobufs | 2 +- src/mesh/generated/meshtastic/clientonly.pb.c | 12 +++ src/mesh/generated/meshtastic/clientonly.pb.h | 73 +++++++++++++++++++ 3 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 src/mesh/generated/meshtastic/clientonly.pb.c create mode 100644 src/mesh/generated/meshtastic/clientonly.pb.h diff --git a/protobufs b/protobufs index 5f00ad569..ee6f408bb 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 5f00ad5691ae7d8a03fd92437b81e9a424e3483f +Subproject commit ee6f408bb3c27b8ca820477cbb3a84ac6c8b0ffc diff --git a/src/mesh/generated/meshtastic/clientonly.pb.c b/src/mesh/generated/meshtastic/clientonly.pb.c new file mode 100644 index 000000000..ebc2ffabc --- /dev/null +++ b/src/mesh/generated/meshtastic/clientonly.pb.c @@ -0,0 +1,12 @@ +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.4.7 */ + +#include "meshtastic/clientonly.pb.h" +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +PB_BIND(meshtastic_DeviceProfile, meshtastic_DeviceProfile, 2) + + + diff --git a/src/mesh/generated/meshtastic/clientonly.pb.h b/src/mesh/generated/meshtastic/clientonly.pb.h new file mode 100644 index 000000000..0f70e09c6 --- /dev/null +++ b/src/mesh/generated/meshtastic/clientonly.pb.h @@ -0,0 +1,73 @@ +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.4.7 */ + +#ifndef PB_MESHTASTIC_MESHTASTIC_CLIENTONLY_PB_H_INCLUDED +#define PB_MESHTASTIC_MESHTASTIC_CLIENTONLY_PB_H_INCLUDED +#include +#include "meshtastic/localonly.pb.h" + +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +/* Struct definitions */ +/* This abstraction is used to contain any configuration for provisioning a node on any client. + It is useful for importing and exporting configurations. */ +typedef struct _meshtastic_DeviceProfile { + /* Long name for the node */ + bool has_long_name; + char long_name[40]; + /* Short name of the node */ + bool has_short_name; + char short_name[5]; + /* The url of the channels from our node */ + pb_callback_t channel_url; + /* The Config of the node */ + bool has_config; + meshtastic_LocalConfig config; + /* The ModuleConfig of the node */ + bool has_module_config; + meshtastic_LocalModuleConfig module_config; +} meshtastic_DeviceProfile; + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Initializer values for message structs */ +#define meshtastic_DeviceProfile_init_default {false, "", false, "", {{NULL}, NULL}, false, meshtastic_LocalConfig_init_default, false, meshtastic_LocalModuleConfig_init_default} +#define meshtastic_DeviceProfile_init_zero {false, "", false, "", {{NULL}, NULL}, false, meshtastic_LocalConfig_init_zero, false, meshtastic_LocalModuleConfig_init_zero} + +/* Field tags (for use in manual encoding/decoding) */ +#define meshtastic_DeviceProfile_long_name_tag 1 +#define meshtastic_DeviceProfile_short_name_tag 2 +#define meshtastic_DeviceProfile_channel_url_tag 3 +#define meshtastic_DeviceProfile_config_tag 4 +#define meshtastic_DeviceProfile_module_config_tag 5 + +/* Struct field encoding specification for nanopb */ +#define meshtastic_DeviceProfile_FIELDLIST(X, a) \ +X(a, STATIC, OPTIONAL, STRING, long_name, 1) \ +X(a, STATIC, OPTIONAL, STRING, short_name, 2) \ +X(a, CALLBACK, OPTIONAL, STRING, channel_url, 3) \ +X(a, STATIC, OPTIONAL, MESSAGE, config, 4) \ +X(a, STATIC, OPTIONAL, MESSAGE, module_config, 5) +#define meshtastic_DeviceProfile_CALLBACK pb_default_field_callback +#define meshtastic_DeviceProfile_DEFAULT NULL +#define meshtastic_DeviceProfile_config_MSGTYPE meshtastic_LocalConfig +#define meshtastic_DeviceProfile_module_config_MSGTYPE meshtastic_LocalModuleConfig + +extern const pb_msgdesc_t meshtastic_DeviceProfile_msg; + +/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ +#define meshtastic_DeviceProfile_fields &meshtastic_DeviceProfile_msg + +/* Maximum encoded size of messages (where known) */ +/* meshtastic_DeviceProfile_size depends on runtime parameters */ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif From 0afeba0c863087c68aa5597765475652bc84e063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Tue, 11 Apr 2023 20:10:54 +0200 Subject: [PATCH 39/56] generate dynamic device array for use in CI scripts Usage: generate_ci_matrix.py platform [extra] e.g. generate_ci_matrix.py esp32 or generate_ci_matrix.py esp32 extra --- bin/generate_ci_matrix.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 bin/generate_ci_matrix.py diff --git a/bin/generate_ci_matrix.py b/bin/generate_ci_matrix.py new file mode 100755 index 000000000..74ff8937e --- /dev/null +++ b/bin/generate_ci_matrix.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python + +"""Generate the CI matrix""" + +import os, sys, configparser, json + +rootdir = 'variants/' + +options = sys.argv[1:] + +outlist=[] + +if len(options) < 1: + print(json.dumps(outlist)) + exit() + +for subdir, dirs, files in os.walk(rootdir): + for file in files: + if file == 'platformio.ini': + config = configparser.ConfigParser() + config.read(subdir + '/' + file) + for c in config.sections(): + if c.startswith('env:'): + section = config[c].name[4:] + if 'extends' in config[config[c].name]: + if config[config[c].name]['extends'] == options[0] + '_base': + if 'board_level' in config[config[c].name]: + if ((config[config[c].name]['board_level'] == 'extra') & ('extra' in options)): + outlist.append(section) + else: + outlist.append(section) + +print(json.dumps(outlist)) \ No newline at end of file From 35983516899b7c9969706c513b7700456bd888d9 Mon Sep 17 00:00:00 2001 From: thebentern Date: Tue, 11 Apr 2023 13:44:33 +0000 Subject: [PATCH 40/56] [create-pull-request] automated change --- version.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.properties b/version.properties index 909888740..02e47fdf2 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 1 -build = 8 +build = 9 From d60ccb42da999988d2c595bc72bcd306beba204c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Wed, 12 Apr 2023 10:06:04 +0200 Subject: [PATCH 41/56] pretty print --- bin/generate_ci_matrix.py | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/bin/generate_ci_matrix.py b/bin/generate_ci_matrix.py index 74ff8937e..2501e83c1 100755 --- a/bin/generate_ci_matrix.py +++ b/bin/generate_ci_matrix.py @@ -2,13 +2,16 @@ """Generate the CI matrix""" -import os, sys, configparser, json +import configparser +import json +import os +import sys -rootdir = 'variants/' +rootdir = "variants/" options = sys.argv[1:] -outlist=[] +outlist = [] if len(options) < 1: print(json.dumps(outlist)) @@ -16,18 +19,20 @@ if len(options) < 1: for subdir, dirs, files in os.walk(rootdir): for file in files: - if file == 'platformio.ini': + if file == "platformio.ini": config = configparser.ConfigParser() - config.read(subdir + '/' + file) + config.read(subdir + "/" + file) for c in config.sections(): - if c.startswith('env:'): + if c.startswith("env:"): section = config[c].name[4:] - if 'extends' in config[config[c].name]: - if config[config[c].name]['extends'] == options[0] + '_base': - if 'board_level' in config[config[c].name]: - if ((config[config[c].name]['board_level'] == 'extra') & ('extra' in options)): + if "extends" in config[config[c].name]: + if config[config[c].name]["extends"] == options[0] + "_base": + if "board_level" in config[config[c].name]: + if ( + config[config[c].name]["board_level"] == "extra" + ) & ("extra" in options): outlist.append(section) else: outlist.append(section) -print(json.dumps(outlist)) \ No newline at end of file +print(json.dumps(outlist)) From 10fac072bbf89dee551b2cd3491377f8e002fb12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Wed, 12 Apr 2023 14:39:25 +0200 Subject: [PATCH 42/56] move codec2 repo to org --- arch/esp32/esp32.ini | 2 +- arch/esp32/esp32c3.ini | 3 +-- arch/esp32/esp32s2.ini | 2 +- arch/esp32/esp32s3.ini | 2 +- variants/MakePython_nRF52840_eink/platformio.ini | 2 +- variants/MakePython_nRF52840_oled/platformio.ini | 2 +- variants/my_esp32s3_diy_eink/platformio.ini | 1 - variants/my_esp32s3_diy_oled/platformio.ini | 1 - variants/tlora_t3s3_v1/platformio.ini | 3 --- variants/tlora_v2_1_18/platformio.ini | 3 --- 10 files changed, 6 insertions(+), 15 deletions(-) diff --git a/arch/esp32/esp32.ini b/arch/esp32/esp32.ini index 5cc48e191..fb83ec2d4 100644 --- a/arch/esp32/esp32.ini +++ b/arch/esp32/esp32.ini @@ -35,7 +35,7 @@ lib_deps = https://github.com/meshtastic/esp32_https_server.git#23665b3adc080a311dcbb586ed5941b5f94d6ea2 h2zero/NimBLE-Arduino@^1.4.0 https://github.com/lewisxhe/XPowersLib.git#84b7373faea3118b6c37954d52f98b8a337148d6 - caveman99/ESP32 Codec2@^1.0.1 + https://github.com/meshtastic/ESP32_Codec2.git#633326c78ac251c059ab3a8c430fcdf25b41672f lib_ignore = segger_rtt diff --git a/arch/esp32/esp32c3.ini b/arch/esp32/esp32c3.ini index cca95f48a..5ebb789ad 100644 --- a/arch/esp32/esp32c3.ini +++ b/arch/esp32/esp32c3.ini @@ -34,8 +34,7 @@ lib_deps = https://github.com/meshtastic/esp32_https_server.git#23665b3adc080a311dcbb586ed5941b5f94d6ea2 h2zero/NimBLE-Arduino@^1.4.0 https://github.com/lewisxhe/XPowersLib.git#84b7373faea3118b6c37954d52f98b8a337148d6 - caveman99/ESP32 Codec2@^1.0.1 - + https://github.com/meshtastic/ESP32_Codec2.git#633326c78ac251c059ab3a8c430fcdf25b41672f lib_ignore = segger_rtt ESP32 BLE Arduino diff --git a/arch/esp32/esp32s2.ini b/arch/esp32/esp32s2.ini index b266d1792..6e75c08c9 100644 --- a/arch/esp32/esp32s2.ini +++ b/arch/esp32/esp32s2.ini @@ -35,7 +35,7 @@ lib_deps = ${environmental_base.lib_deps} https://github.com/meshtastic/esp32_https_server.git#23665b3adc080a311dcbb586ed5941b5f94d6ea2 https://github.com/lewisxhe/XPowersLib.git#84b7373faea3118b6c37954d52f98b8a337148d6 - caveman99/ESP32 Codec2@^1.0.1 + https://github.com/meshtastic/ESP32_Codec2.git#633326c78ac251c059ab3a8c430fcdf25b41672f lib_ignore = segger_rtt diff --git a/arch/esp32/esp32s3.ini b/arch/esp32/esp32s3.ini index 9a042b22b..bb0214f46 100644 --- a/arch/esp32/esp32s3.ini +++ b/arch/esp32/esp32s3.ini @@ -35,7 +35,7 @@ lib_deps = https://github.com/meshtastic/esp32_https_server.git#23665b3adc080a311dcbb586ed5941b5f94d6ea2 h2zero/NimBLE-Arduino@^1.4.0 https://github.com/lewisxhe/XPowersLib.git#84b7373faea3118b6c37954d52f98b8a337148d6 - caveman99/ESP32 Codec2@^1.0.1 + https://github.com/meshtastic/ESP32_Codec2.git#633326c78ac251c059ab3a8c430fcdf25b41672f lib_ignore = segger_rtt diff --git a/variants/MakePython_nRF52840_eink/platformio.ini b/variants/MakePython_nRF52840_eink/platformio.ini index 825566146..9ed5a8594 100644 --- a/variants/MakePython_nRF52840_eink/platformio.ini +++ b/variants/MakePython_nRF52840_eink/platformio.ini @@ -7,7 +7,7 @@ build_flags = ${nrf52840_base.build_flags} -Ivariants/MakePython_nRF52840_eink - build_src_filter = ${nrf52_base.build_src_filter} +<../variants/MakePython_nRF52840_eink> lib_deps = ${nrf52840_base.lib_deps} - caveman99/ESP32 Codec2@^1.0.1 + https://github.com/meshtastic/ESP32_Codec2.git#633326c78ac251c059ab3a8c430fcdf25b41672f zinggjm/GxEPD2@^1.4.9 debug_tool = jlink upload_port = /dev/ttyACM4 diff --git a/variants/MakePython_nRF52840_oled/platformio.ini b/variants/MakePython_nRF52840_oled/platformio.ini index 35011fb09..9332bd786 100644 --- a/variants/MakePython_nRF52840_oled/platformio.ini +++ b/variants/MakePython_nRF52840_oled/platformio.ini @@ -6,5 +6,5 @@ build_flags = ${nrf52840_base.build_flags} -Ivariants/MakePython_nRF52840_oled - build_src_filter = ${nrf52_base.build_src_filter} +<../variants/MakePython_nRF52840_oled> lib_deps = ${nrf52840_base.lib_deps} - caveman99/ESP32 Codec2@^1.0.1 + https://github.com/meshtastic/ESP32_Codec2.git#633326c78ac251c059ab3a8c430fcdf25b41672f debug_tool = jlink diff --git a/variants/my_esp32s3_diy_eink/platformio.ini b/variants/my_esp32s3_diy_eink/platformio.ini index 01376f256..8405f784e 100644 --- a/variants/my_esp32s3_diy_eink/platformio.ini +++ b/variants/my_esp32s3_diy_eink/platformio.ini @@ -12,7 +12,6 @@ platform_packages = tool-esptoolpy@^1.40500.0 lib_deps = ${esp32_base.lib_deps} - caveman99/ESP32 Codec2@^1.0.1 zinggjm/GxEPD2@^1.5.1 adafruit/Adafruit NeoPixel@^1.10.7 build_unflags = -DARDUINO_USB_MODE=1 diff --git a/variants/my_esp32s3_diy_oled/platformio.ini b/variants/my_esp32s3_diy_oled/platformio.ini index 189e87fba..1430dfd96 100644 --- a/variants/my_esp32s3_diy_oled/platformio.ini +++ b/variants/my_esp32s3_diy_oled/platformio.ini @@ -12,7 +12,6 @@ platform_packages = tool-esptoolpy@^1.40500.0 lib_deps = ${esp32_base.lib_deps} - caveman99/ESP32 Codec2@^1.0.1 adafruit/Adafruit NeoPixel@^1.10.7 build_unflags = -DARDUINO_USB_MODE=1 build_flags = diff --git a/variants/tlora_t3s3_v1/platformio.ini b/variants/tlora_t3s3_v1/platformio.ini index 568e8af42..bef57c3b4 100644 --- a/variants/tlora_t3s3_v1/platformio.ini +++ b/variants/tlora_t3s3_v1/platformio.ini @@ -2,9 +2,6 @@ extends = esp32s3_base board = tlora-t3s3-v1 upload_protocol = esp-builtin -lib_deps = - ${esp32_base.lib_deps} - caveman99/ESP32 Codec2@^1.0.1 build_flags = ${esp32_base.build_flags} -D TLORA_T3S3_V1 -I variants/tlora_t3s3_v1 \ No newline at end of file diff --git a/variants/tlora_v2_1_18/platformio.ini b/variants/tlora_v2_1_18/platformio.ini index c61b8a28c..01741ca13 100644 --- a/variants/tlora_v2_1_18/platformio.ini +++ b/variants/tlora_v2_1_18/platformio.ini @@ -1,9 +1,6 @@ [env:tlora-v2-1-1.8] extends = esp32_base board = ttgo-lora32-v21 -lib_deps = - ${esp32_base.lib_deps} - caveman99/ESP32 Codec2@^1.0.1 build_flags = ${esp32_base.build_flags} -D TLORA_V2_1_18 -I variants/tlora_v2_1_18 \ No newline at end of file From a9ce4338ff208dc0ef9c7c74b4e9e3fd5a29ac03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Wed, 12 Apr 2023 19:04:19 +0200 Subject: [PATCH 43/56] update library version --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index d8c55fb78..c339cf992 100644 --- a/platformio.ini +++ b/platformio.ini @@ -85,7 +85,7 @@ lib_deps = ${env.lib_deps} mprograms/QMC5883LCompass@^1.1.1 end2endzone/NonBlockingRTTTL@^1.3.0 - https://github.com/meshtastic/SparkFun_ATECCX08a_Arduino_Library.git#52b5282639d08a8cbd4b748363089eed6102dc76 + https://github.com/meshtastic/SparkFun_ATECCX08a_Arduino_Library.git#5cf62b36c6f30bc72a07bdb2c11fc9a22d1e31da build_flags = ${env.build_flags} -Os -DRADIOLIB_SPI_PARANOID=0 build_src_filter = ${env.build_src_filter} - From e0da661632b627d4e2d28d3dbf8699cfce8e17ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Thu, 13 Apr 2023 15:13:36 +0200 Subject: [PATCH 44/56] remove screen brightness again --- src/ButtonThread.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ButtonThread.h b/src/ButtonThread.h index b295f896a..13c424336 100644 --- a/src/ButtonThread.h +++ b/src/ButtonThread.h @@ -123,7 +123,6 @@ class ButtonThread : public concurrency::OSThread static void userButtonPressedLong() { // LOG_DEBUG("Long press!\n"); - screen->adjustBrightness(); // If user button is held down for 10 seconds, shutdown the device. if ((millis() - longPressTime > 10000) && (longPressTime > 0)) { #if defined(ARCH_NRF52) || defined(ARCH_ESP32) From 7bd836673e654e2760114a207ad151dc89c6963e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Thu, 13 Apr 2023 18:19:33 +0200 Subject: [PATCH 45/56] return shutdown time to 5 seconds. --- src/ButtonThread.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ButtonThread.h b/src/ButtonThread.h index 13c424336..0e9d060dc 100644 --- a/src/ButtonThread.h +++ b/src/ButtonThread.h @@ -123,8 +123,8 @@ class ButtonThread : public concurrency::OSThread static void userButtonPressedLong() { // LOG_DEBUG("Long press!\n"); - // If user button is held down for 10 seconds, shutdown the device. - if ((millis() - longPressTime > 10000) && (longPressTime > 0)) { + // If user button is held down for 5 seconds, shutdown the device. + if ((millis() - longPressTime > 5000) && (longPressTime > 0)) { #if defined(ARCH_NRF52) || defined(ARCH_ESP32) // Do actual shutdown when button released, otherwise the button release // may wake the board immediatedly. From 5d41e9fe9d01f1187b81b55952f0e90b0f1da92a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Thu, 13 Apr 2023 23:09:02 +0200 Subject: [PATCH 46/56] don't grow nodedb if memory is tight. also remove unconditional reboot on low heap. This is counter productive with this change --- src/main.cpp | 9 --------- src/mesh/NodeDB.cpp | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index c2e702115..53ed53b9d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -142,15 +142,6 @@ static int32_t ledBlinker() setLed(ledOn); - auto newHeap = memGet.getFreeHeap(); - if (newHeap < 10000) { - LOG_DEBUG("\n\n====== heap too low [10000] -> reboot in 1s ======\n\n"); -#ifdef HAS_SCREEN - screen->startRebootScreen(); -#endif - rebootAtMsec = millis() + 900; - } - // have a very sparse duty cycle of LED being on, unless charging, then blink 0.5Hz square wave rate to indicate that return powerStatus->getIsCharging() ? 1000 : (ledOn ? 1 : 1000); } diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 02749feb8..964ae37ab 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -767,7 +767,7 @@ meshtastic_NodeInfo *NodeDB::getOrCreateNode(NodeNum n) meshtastic_NodeInfo *info = getNode(n); if (!info) { - if (*numNodes >= MAX_NUM_NODES) { + if ((*numNodes >= MAX_NUM_NODES) || (memGet.getFreeHeap() < meshtastic_NodeInfo_size * 3)) { screen->print("warning: node_db full! erasing oldest entry\n"); // look for oldest node and erase it uint32_t oldest = UINT32_MAX; From b43a5bc4f8e1cc88e6ff0c325d33eddb9d7586cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Thu, 13 Apr 2023 22:20:49 +0200 Subject: [PATCH 47/56] Fix missing msh default topic. --- src/Power.cpp | 4 ++-- src/mqtt/MQTT.cpp | 6 +----- src/mqtt/MQTT.h | 3 +++ 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Power.cpp b/src/Power.cpp index 6b5bebe4d..4bce83afb 100644 --- a/src/Power.cpp +++ b/src/Power.cpp @@ -350,12 +350,12 @@ void Power::readPowerStatus() char mac[18]; sprintf(mac, "!%02x%02x%02x%02x", dmac[2], dmac[3], dmac[4], dmac[5]); auto newHeap = ESP.getFreeHeap(); - std::string heapTopic = "msh/2/heap/" + std::string(mac); + std::string heapTopic = (*moduleConfig.mqtt.root ? moduleConfig.mqtt.root : "msh") + "/2/heap/" + std::string(mac); std::string heapString = std::to_string(newHeap); mqtt->pubSub.publish(heapTopic.c_str(), heapString.c_str(), false); // auto fragHeap = ESP.getHeapFragmentation(); auto wifiRSSI = WiFi.RSSI(); - heapTopic = "msh/2/wifi/" + std::string(mac); + heapTopic = (*moduleConfig.mqtt.root ? moduleConfig.mqtt.root : "msh") + "/2/wifi/" + std::string(mac); std::string wifiString = std::to_string(wifiRSSI); mqtt->pubSub.publish(heapTopic.c_str(), wifiString.c_str(), false); } diff --git a/src/mqtt/MQTT.cpp b/src/mqtt/MQTT.cpp index c0758019a..bd1a85641 100644 --- a/src/mqtt/MQTT.cpp +++ b/src/mqtt/MQTT.cpp @@ -19,10 +19,6 @@ const int reconnectMax = 5; MQTT *mqtt; -std::string statusTopic = "/2/stat/"; -std::string cryptTopic = "/2/c/"; // msh/2/c/CHANNELID/NODEID -std::string jsonTopic = "/2/json/"; // msh/2/json/CHANNELID/NODEID - static MemoryDynamic staticMqttPool; Allocator &mqttPool = staticMqttPool; @@ -164,7 +160,7 @@ MQTT::MQTT() : concurrency::OSThread("mqtt"), pubSub(mqttClient), mqttQueue(MAX_ assert(!mqtt); mqtt = this; - if (moduleConfig.mqtt.root) { + if (*moduleConfig.mqtt.root) { statusTopic = moduleConfig.mqtt.root + statusTopic; cryptTopic = moduleConfig.mqtt.root + cryptTopic; jsonTopic = moduleConfig.mqtt.root + jsonTopic; diff --git a/src/mqtt/MQTT.h b/src/mqtt/MQTT.h index 3065cc08e..1e626c3e0 100644 --- a/src/mqtt/MQTT.h +++ b/src/mqtt/MQTT.h @@ -69,6 +69,9 @@ class MQTT : private concurrency::OSThread virtual int32_t runOnce() override; private: + std::string statusTopic = "/2/stat/"; + std::string cryptTopic = "/2/c/"; // msh/2/c/CHANNELID/NODEID + std::string jsonTopic = "/2/json/"; // msh/2/json/CHANNELID/NODEID /** return true if we have a channel that wants uplink/downlink */ bool wantsLink() const; From 309d4fc7f254136ce468ba7725b3b9681c811a8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Fri, 14 Apr 2023 10:55:05 +0200 Subject: [PATCH 48/56] add flush to filesystem before closing write file. --- src/FSCommon.cpp | 1 + src/mesh/NodeDB.cpp | 1 + src/mesh/http/ContentHandler.cpp | 7 ++++++- src/modules/esp32/RangeTestModule.cpp | 3 ++- src/xmodem.cpp | 2 ++ 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/FSCommon.cpp b/src/FSCommon.cpp index 32e5d7e28..cc99caed8 100644 --- a/src/FSCommon.cpp +++ b/src/FSCommon.cpp @@ -34,6 +34,7 @@ bool copyFile(const char *from, const char *to) f2.write(cbuffer, i); } + f2.flush(); f2.close(); f1.close(); return true; diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 02749feb8..7416743f0 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -490,6 +490,7 @@ bool NodeDB::saveProto(const char *filename, size_t protoSize, const pb_msgdesc_ } else { okay = true; } + f.flush(); f.close(); // brief window of risk here ;-) diff --git a/src/mesh/http/ContentHandler.cpp b/src/mesh/http/ContentHandler.cpp index 03aab54ae..eb8f8fd12 100644 --- a/src/mesh/http/ContentHandler.cpp +++ b/src/mesh/http/ContentHandler.cpp @@ -234,15 +234,18 @@ void htmlDeleteDir(const char *dirname) while (file) { if (file.isDirectory() && !String(file.name()).endsWith(".")) { htmlDeleteDir(file.name()); + file.flush(); file.close(); } else { String fileName = String(file.name()); + file.flush(); file.close(); LOG_DEBUG(" %s\n", fileName.c_str()); FSCom.remove(fileName); } file = root.openNextFile(); } + root.flush(); root.close(); } @@ -521,7 +524,7 @@ void handleFormUpload(HTTPRequest *req, HTTPResponse *res) std::string pathname = "/static/" + filename; // Create a new file to stream the data into - File file = FSCom.open(pathname.c_str(), "w"); + File file = FSCom.open(pathname.c_str(), FILE_O_WRITE); size_t fileLength = 0; didwrite = true; @@ -536,6 +539,7 @@ void handleFormUpload(HTTPRequest *req, HTTPResponse *res) // Abort the transfer if there is less than 50k space left on the filesystem. if (FSCom.totalBytes() - FSCom.usedBytes() < 51200) { + file.flush(); file.close(); res->println("

Write aborted! Reserving 50k on filesystem.

"); @@ -553,6 +557,7 @@ void handleFormUpload(HTTPRequest *req, HTTPResponse *res) } // enableLoopWDT(); + file.flush(); file.close(); res->printf("

Saved %d bytes to %s

", (int)fileLength, pathname.c_str()); } diff --git a/src/modules/esp32/RangeTestModule.cpp b/src/modules/esp32/RangeTestModule.cpp index 608e0868c..e8821f9a0 100644 --- a/src/modules/esp32/RangeTestModule.cpp +++ b/src/modules/esp32/RangeTestModule.cpp @@ -226,7 +226,7 @@ bool RangeTestModuleRadio::appendFile(const meshtastic_MeshPacket &mp) } else { LOG_ERROR("File write failed\n"); } - + fileToWrite.flush(); fileToWrite.close(); } @@ -275,6 +275,7 @@ bool RangeTestModuleRadio::appendFile(const meshtastic_MeshPacket &mp) // TODO: If quotes are found in the payload, it has to be escaped. fileToAppend.printf("\"%s\"\n", p.payload.bytes); + fileToAppend.flush(); fileToAppend.close(); return 1; diff --git a/src/xmodem.cpp b/src/xmodem.cpp index f8b5084dc..e8727c468 100644 --- a/src/xmodem.cpp +++ b/src/xmodem.cpp @@ -142,12 +142,14 @@ void XModemAdapter::handlePacket(meshtastic_XModem xmodemPacket) case meshtastic_XModem_Control_EOT: // End of transmission sendControl(meshtastic_XModem_Control_ACK); + file.flush(); file.close(); isReceiving = false; break; case meshtastic_XModem_Control_CAN: // Cancel transmission and remove file sendControl(meshtastic_XModem_Control_ACK); + file.flush(); file.close(); FSCom.remove(filename); isReceiving = false; From a76cb948510105aa1cdb0330d38bb4815750015c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Mon, 17 Apr 2023 18:22:12 +0200 Subject: [PATCH 49/56] Revert "Trying to debug transient "disconnects" in iOS (#2312)" (#2435) This reverts commit d17aafa91a2475d5c3d7efaa4d22250f775f32eb. --- src/platform/nrf52/NRF52Bluetooth.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platform/nrf52/NRF52Bluetooth.cpp b/src/platform/nrf52/NRF52Bluetooth.cpp index 59d11717a..044b57ae6 100644 --- a/src/platform/nrf52/NRF52Bluetooth.cpp +++ b/src/platform/nrf52/NRF52Bluetooth.cpp @@ -92,12 +92,12 @@ void startAdv(void) Bluefruit.Advertising.addFlags(BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE); // IncludeService UUID - Bluefruit.ScanResponse.addService(meshBleService); + // Bluefruit.ScanResponse.addService(meshBleService); Bluefruit.ScanResponse.addTxPower(); Bluefruit.ScanResponse.addName(); // Include Name - Bluefruit.Advertising.addName(); + // Bluefruit.Advertising.addName(); Bluefruit.Advertising.addService(meshBleService); /* Start Advertising From d43ddc9ec2aae5381a082a93c5479787861fc2b5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 17 Apr 2023 15:42:42 -0500 Subject: [PATCH 50/56] [create-pull-request] automated change (#2436) --- protobufs | 2 +- src/mesh/generated/meshtastic/mesh.pb.c | 6 +++ src/mesh/generated/meshtastic/mesh.pb.h | 50 +++++++++++++++++++++ src/mesh/generated/meshtastic/portnums.pb.h | 2 + 4 files changed, 59 insertions(+), 1 deletion(-) diff --git a/protobufs b/protobufs index ee6f408bb..ef2bc66bb 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit ee6f408bb3c27b8ca820477cbb3a84ac6c8b0ffc +Subproject commit ef2bc66bba41e8ef98ea893e46eb36a2da40cb5e diff --git a/src/mesh/generated/meshtastic/mesh.pb.c b/src/mesh/generated/meshtastic/mesh.pb.c index 0c3c155f6..ce7d48b14 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.c +++ b/src/mesh/generated/meshtastic/mesh.pb.c @@ -48,6 +48,12 @@ PB_BIND(meshtastic_ToRadio, meshtastic_ToRadio, 2) PB_BIND(meshtastic_Compressed, meshtastic_Compressed, AUTO) +PB_BIND(meshtastic_NeighborInfo, meshtastic_NeighborInfo, AUTO) + + +PB_BIND(meshtastic_Neighbor, meshtastic_Neighbor, AUTO) + + PB_BIND(meshtastic_DeviceMetadata, meshtastic_DeviceMetadata, AUTO) diff --git a/src/mesh/generated/meshtastic/mesh.pb.h b/src/mesh/generated/meshtastic/mesh.pb.h index e95cffdfe..984939702 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.h +++ b/src/mesh/generated/meshtastic/mesh.pb.h @@ -680,6 +680,25 @@ typedef struct _meshtastic_Compressed { meshtastic_Compressed_data_t data; } meshtastic_Compressed; +/* A single edge in the mesh */ +typedef struct _meshtastic_Neighbor { + /* Node ID of neighbor */ + uint32_t node_id; + /* SNR of last heard message */ + float snr; +} meshtastic_Neighbor; + +/* Full info on edges for a single node */ +typedef struct _meshtastic_NeighborInfo { + /* The node ID of the node sending info on its neighbors */ + uint32_t node_id; + /* Field to pass neighbor info for the next sending cycle */ + uint32_t last_sent_by_id; + /* The list of out edges from this node */ + pb_size_t neighbors_count; + meshtastic_Neighbor neighbors[10]; +} meshtastic_NeighborInfo; + /* Device metadata response */ typedef struct _meshtastic_DeviceMetadata { /* Device firmware version string */ @@ -813,6 +832,8 @@ extern "C" { #define meshtastic_Compressed_portnum_ENUMTYPE meshtastic_PortNum + + #define meshtastic_DeviceMetadata_role_ENUMTYPE meshtastic_Config_DeviceConfig_Role #define meshtastic_DeviceMetadata_hw_model_ENUMTYPE meshtastic_HardwareModel @@ -832,6 +853,8 @@ extern "C" { #define meshtastic_FromRadio_init_default {0, 0, {meshtastic_MeshPacket_init_default}} #define meshtastic_ToRadio_init_default {0, {meshtastic_MeshPacket_init_default}} #define meshtastic_Compressed_init_default {_meshtastic_PortNum_MIN, {0, {0}}} +#define meshtastic_NeighborInfo_init_default {0, 0, 0, {meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default}} +#define meshtastic_Neighbor_init_default {0, 0} #define meshtastic_DeviceMetadata_init_default {"", 0, 0, 0, 0, 0, _meshtastic_Config_DeviceConfig_Role_MIN, 0, _meshtastic_HardwareModel_MIN} #define meshtastic_Position_init_zero {0, 0, 0, 0, _meshtastic_Position_LocSource_MIN, _meshtastic_Position_AltSource_MIN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} #define meshtastic_User_init_zero {"", "", "", {0}, _meshtastic_HardwareModel_MIN, 0} @@ -847,6 +870,8 @@ extern "C" { #define meshtastic_FromRadio_init_zero {0, 0, {meshtastic_MeshPacket_init_zero}} #define meshtastic_ToRadio_init_zero {0, {meshtastic_MeshPacket_init_zero}} #define meshtastic_Compressed_init_zero {_meshtastic_PortNum_MIN, {0, {0}}} +#define meshtastic_NeighborInfo_init_zero {0, 0, 0, {meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero}} +#define meshtastic_Neighbor_init_zero {0, 0} #define meshtastic_DeviceMetadata_init_zero {"", 0, 0, 0, 0, 0, _meshtastic_Config_DeviceConfig_Role_MIN, 0, _meshtastic_HardwareModel_MIN} /* Field tags (for use in manual encoding/decoding) */ @@ -948,6 +973,11 @@ extern "C" { #define meshtastic_ToRadio_xmodemPacket_tag 5 #define meshtastic_Compressed_portnum_tag 1 #define meshtastic_Compressed_data_tag 2 +#define meshtastic_Neighbor_node_id_tag 1 +#define meshtastic_Neighbor_snr_tag 2 +#define meshtastic_NeighborInfo_node_id_tag 1 +#define meshtastic_NeighborInfo_last_sent_by_id_tag 2 +#define meshtastic_NeighborInfo_neighbors_tag 3 #define meshtastic_DeviceMetadata_firmware_version_tag 1 #define meshtastic_DeviceMetadata_device_state_version_tag 2 #define meshtastic_DeviceMetadata_canShutdown_tag 3 @@ -1157,6 +1187,20 @@ X(a, STATIC, SINGULAR, BYTES, data, 2) #define meshtastic_Compressed_CALLBACK NULL #define meshtastic_Compressed_DEFAULT NULL +#define meshtastic_NeighborInfo_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UINT32, node_id, 1) \ +X(a, STATIC, SINGULAR, UINT32, last_sent_by_id, 2) \ +X(a, STATIC, REPEATED, MESSAGE, neighbors, 3) +#define meshtastic_NeighborInfo_CALLBACK NULL +#define meshtastic_NeighborInfo_DEFAULT NULL +#define meshtastic_NeighborInfo_neighbors_MSGTYPE meshtastic_Neighbor + +#define meshtastic_Neighbor_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UINT32, node_id, 1) \ +X(a, STATIC, SINGULAR, FLOAT, snr, 2) +#define meshtastic_Neighbor_CALLBACK NULL +#define meshtastic_Neighbor_DEFAULT NULL + #define meshtastic_DeviceMetadata_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, STRING, firmware_version, 1) \ X(a, STATIC, SINGULAR, UINT32, device_state_version, 2) \ @@ -1184,6 +1228,8 @@ extern const pb_msgdesc_t meshtastic_QueueStatus_msg; extern const pb_msgdesc_t meshtastic_FromRadio_msg; extern const pb_msgdesc_t meshtastic_ToRadio_msg; extern const pb_msgdesc_t meshtastic_Compressed_msg; +extern const pb_msgdesc_t meshtastic_NeighborInfo_msg; +extern const pb_msgdesc_t meshtastic_Neighbor_msg; extern const pb_msgdesc_t meshtastic_DeviceMetadata_msg; /* Defines for backwards compatibility with code written before nanopb-0.4.0 */ @@ -1201,6 +1247,8 @@ extern const pb_msgdesc_t meshtastic_DeviceMetadata_msg; #define meshtastic_FromRadio_fields &meshtastic_FromRadio_msg #define meshtastic_ToRadio_fields &meshtastic_ToRadio_msg #define meshtastic_Compressed_fields &meshtastic_Compressed_msg +#define meshtastic_NeighborInfo_fields &meshtastic_NeighborInfo_msg +#define meshtastic_Neighbor_fields &meshtastic_Neighbor_msg #define meshtastic_DeviceMetadata_fields &meshtastic_DeviceMetadata_msg /* Maximum encoded size of messages (where known) */ @@ -1211,6 +1259,8 @@ extern const pb_msgdesc_t meshtastic_DeviceMetadata_msg; #define meshtastic_LogRecord_size 81 #define meshtastic_MeshPacket_size 321 #define meshtastic_MyNodeInfo_size 179 +#define meshtastic_NeighborInfo_size 142 +#define meshtastic_Neighbor_size 11 #define meshtastic_NodeInfo_size 261 #define meshtastic_Position_size 137 #define meshtastic_QueueStatus_size 23 diff --git a/src/mesh/generated/meshtastic/portnums.pb.h b/src/mesh/generated/meshtastic/portnums.pb.h index 59cf0ebe5..ccf94372e 100644 --- a/src/mesh/generated/meshtastic/portnums.pb.h +++ b/src/mesh/generated/meshtastic/portnums.pb.h @@ -85,6 +85,8 @@ typedef enum _meshtastic_PortNum { /* Provides a traceroute functionality to show the route a packet towards a certain destination would take on the mesh. */ meshtastic_PortNum_TRACEROUTE_APP = 70, + /* Aggregates edge info for the network by sending out a list of each node's neighbors */ + meshtastic_PortNum_NEIGHBORINFO_APP = 71, /* Private applications should use portnums >= 256. To simplify initial development and testing you can use "PRIVATE_APP" in your code without needing to rebuild protobuf files (via [regen-protos.sh](https://github.com/meshtastic/firmware/blob/master/bin/regen-protos.sh)) */ From c452c2ab4080e2f9f6eb4225c05e6c30b97bae94 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 17 Apr 2023 19:42:54 -0500 Subject: [PATCH 51/56] [create-pull-request] automated change (#2437) Co-authored-by: thebentern --- version.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.properties b/version.properties index 02e47fdf2..253a4d545 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 1 -build = 9 +build = 10 From 584615bb4b4b2813790ca574880cbc5871cd9286 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Tue, 18 Apr 2023 13:37:50 +0200 Subject: [PATCH 52/56] fix topic construction for mqtt debug --- src/Power.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Power.cpp b/src/Power.cpp index 06e887433..6d8efcb0a 100644 --- a/src/Power.cpp +++ b/src/Power.cpp @@ -351,14 +351,13 @@ void Power::readPowerStatus() sprintf(mac, "!%02x%02x%02x%02x", dmac[2], dmac[3], dmac[4], dmac[5]); auto newHeap = memGet.getFreeHeap(); - std::string heapTopic = (*moduleConfig.mqtt.root ? moduleConfig.mqtt.root : "msh") + "/2/heap/" + std::string(mac); + std::string heapTopic = (*moduleConfig.mqtt.root ? moduleConfig.mqtt.root : "msh") + std::string("/2/heap/") + std::string(mac); std::string heapString = std::to_string(newHeap); mqtt->pubSub.publish(heapTopic.c_str(), heapString.c_str(), false); - // auto fragHeap = memGet.getHeapFragmentation(); auto wifiRSSI = WiFi.RSSI(); - heapTopic = (*moduleConfig.mqtt.root ? moduleConfig.mqtt.root : "msh") + "/2/wifi/" + std::string(mac); + std::string wifiTopic = (*moduleConfig.mqtt.root ? moduleConfig.mqtt.root : "msh") + std::string("/2/wifi/") + std::string(mac); std::string wifiString = std::to_string(wifiRSSI); - mqtt->pubSub.publish(heapTopic.c_str(), wifiString.c_str(), false); + mqtt->pubSub.publish(wifiTopic.c_str(), wifiString.c_str(), false); } #endif From 87c59d7d61bf742491874882f6b8e61929fb6f21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Tue, 18 Apr 2023 14:08:06 +0200 Subject: [PATCH 53/56] fmt --- src/Power.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Power.cpp b/src/Power.cpp index 6d8efcb0a..6bd679ae2 100644 --- a/src/Power.cpp +++ b/src/Power.cpp @@ -351,11 +351,13 @@ void Power::readPowerStatus() sprintf(mac, "!%02x%02x%02x%02x", dmac[2], dmac[3], dmac[4], dmac[5]); auto newHeap = memGet.getFreeHeap(); - std::string heapTopic = (*moduleConfig.mqtt.root ? moduleConfig.mqtt.root : "msh") + std::string("/2/heap/") + std::string(mac); + std::string heapTopic = + (*moduleConfig.mqtt.root ? moduleConfig.mqtt.root : "msh") + std::string("/2/heap/") + std::string(mac); std::string heapString = std::to_string(newHeap); mqtt->pubSub.publish(heapTopic.c_str(), heapString.c_str(), false); auto wifiRSSI = WiFi.RSSI(); - std::string wifiTopic = (*moduleConfig.mqtt.root ? moduleConfig.mqtt.root : "msh") + std::string("/2/wifi/") + std::string(mac); + std::string wifiTopic = + (*moduleConfig.mqtt.root ? moduleConfig.mqtt.root : "msh") + std::string("/2/wifi/") + std::string(mac); std::string wifiString = std::to_string(wifiRSSI); mqtt->pubSub.publish(wifiTopic.c_str(), wifiString.c_str(), false); } From ac40f7769400e5eae7807cdb120ed855acfa9836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Wed, 12 Apr 2023 10:04:29 +0200 Subject: [PATCH 54/56] Draft for now, please test --- platformio.ini | 2 +- src/modules/Telemetry/Sensor/BME680Sensor.cpp | 61 +++++++++++++++++-- src/modules/Telemetry/Sensor/BME680Sensor.h | 28 ++++++++- 3 files changed, 84 insertions(+), 7 deletions(-) diff --git a/platformio.ini b/platformio.ini index c339cf992..508f3615b 100644 --- a/platformio.ini +++ b/platformio.ini @@ -105,7 +105,7 @@ lib_deps = adafruit/Adafruit Unified Sensor@^1.1.9 adafruit/Adafruit BMP280 Library@^2.6.6 adafruit/Adafruit BME280 Library@^2.2.2 - adafruit/Adafruit BME680 Library@^2.0.1 + https://github.com/meshtastic/BSEC-Arduino-library.git#452f9a7ffa8b53e1debe2c454fe375dfad98b507 adafruit/Adafruit MCP9808 Library@^2.0.0 adafruit/Adafruit INA260 Library@^1.5.0 adafruit/Adafruit INA219@^1.2.0 diff --git a/src/modules/Telemetry/Sensor/BME680Sensor.cpp b/src/modules/Telemetry/Sensor/BME680Sensor.cpp index f05246d52..21beedcea 100644 --- a/src/modules/Telemetry/Sensor/BME680Sensor.cpp +++ b/src/modules/Telemetry/Sensor/BME680Sensor.cpp @@ -1,8 +1,8 @@ #include "BME680Sensor.h" #include "../mesh/generated/meshtastic/telemetry.pb.h" +#include "FSCommon.h" #include "TelemetrySensor.h" #include "configuration.h" -#include BME680Sensor::BME680Sensor() : TelemetrySensor(meshtastic_TelemetrySensorType_BME680, "BME680") {} @@ -12,7 +12,15 @@ int32_t BME680Sensor::runOnce() if (!hasSensor()) { return DEFAULT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS; } - status = bme680.begin(nodeTelemetrySensorsMap[sensorType]); + bme680.begin(nodeTelemetrySensorsMap[sensorType], Wire); + if (bme680.bsecStatus == BSEC_OK) { + bme680.setConfig(bsec_config_iaq); + loadState(); + bme680.updateSubscription(sensorList, 13, BSEC_SAMPLE_RATE_LP); + status = 1; + } else { + status = 0; + } return initI2CSensor(); } @@ -21,11 +29,56 @@ void BME680Sensor::setup() {} bool BME680Sensor::getMetrics(meshtastic_Telemetry *measurement) { - bme680.performReading(); + bme680.run(); measurement->variant.environment_metrics.temperature = bme680.temperature; measurement->variant.environment_metrics.relative_humidity = bme680.humidity; measurement->variant.environment_metrics.barometric_pressure = bme680.pressure / 100.0F; - measurement->variant.environment_metrics.gas_resistance = bme680.gas_resistance / 1000.0; + measurement->variant.environment_metrics.gas_resistance = bme680.gasResistance / 1000.0; + updateState(); + + // Check if we need to save state to filesystem (every STATE_SAVE_PERIOD ms) return true; +} + +void BME680Sensor::loadState() +{ +#ifdef FSCom + if (File file = FSCom.open(bsecConfigFileName, FILE_O_READ)) { + file.read((uint8_t *)&bsecState, BSEC_MAX_STATE_BLOB_SIZE); + file.close(); + bme680.setState(bsecState); + } else { + FSCom.remove(bsecConfigFileName); + } +#endif +} + +void BME680Sensor::updateState() +{ +#ifdef FSCom + bool update = false; + if (stateUpdateCounter == 0) { + /* First state update when IAQ accuracy is >= 3 */ + if (bme680.iaqAccuracy >= 3) { + update = true; + stateUpdateCounter++; + } + } else { + /* Update every STATE_SAVE_PERIOD minutes */ + if ((stateUpdateCounter * STATE_SAVE_PERIOD) < millis()) { + update = true; + stateUpdateCounter++; + } + } + + if (update) { + bme680.getState(bsecState); + if (File file = FSCom.open(bsecConfigFileName, FILE_O_WRITE)) { + file.write((uint8_t *)&bsecState, BSEC_MAX_STATE_BLOB_SIZE); + file.flush(); + file.close(); + } + } +#endif } \ No newline at end of file diff --git a/src/modules/Telemetry/Sensor/BME680Sensor.h b/src/modules/Telemetry/Sensor/BME680Sensor.h index d59374803..78adad01e 100644 --- a/src/modules/Telemetry/Sensor/BME680Sensor.h +++ b/src/modules/Telemetry/Sensor/BME680Sensor.h @@ -1,14 +1,38 @@ #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "TelemetrySensor.h" -#include +#include + +#define STATE_SAVE_PERIOD UINT32_C(360 * 60 * 1000) + +const uint8_t bsec_config_iaq[] = { +#include +}; class BME680Sensor : virtual public TelemetrySensor { private: - Adafruit_BME680 bme680; + Bsec bme680; protected: virtual void setup() override; + const char *bsecConfigFileName = "/prefs/bsec.dat"; + uint8_t bsecState[BSEC_MAX_STATE_BLOB_SIZE] = {0}; + uint16_t stateUpdateCounter = 0; + bsec_virtual_sensor_t sensorList[13] = {BSEC_OUTPUT_IAQ, + BSEC_OUTPUT_STATIC_IAQ, + BSEC_OUTPUT_CO2_EQUIVALENT, + BSEC_OUTPUT_BREATH_VOC_EQUIVALENT, + BSEC_OUTPUT_RAW_TEMPERATURE, + BSEC_OUTPUT_RAW_PRESSURE, + BSEC_OUTPUT_RAW_HUMIDITY, + BSEC_OUTPUT_RAW_GAS, + BSEC_OUTPUT_STABILIZATION_STATUS, + BSEC_OUTPUT_RUN_IN_STATUS, + BSEC_OUTPUT_SENSOR_HEAT_COMPENSATED_TEMPERATURE, + BSEC_OUTPUT_SENSOR_HEAT_COMPENSATED_HUMIDITY, + BSEC_OUTPUT_GAS_PERCENTAGE}; + void loadState(); + void updateState(); public: BME680Sensor(); From 1621fbb5ab43189ca139211566d819ab946e1946 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Fri, 14 Apr 2023 10:38:57 +0200 Subject: [PATCH 55/56] add debug/info print --- src/modules/Telemetry/Sensor/BME680Sensor.cpp | 34 +++++++++++++++---- src/modules/Telemetry/Sensor/BME680Sensor.h | 2 +- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/src/modules/Telemetry/Sensor/BME680Sensor.cpp b/src/modules/Telemetry/Sensor/BME680Sensor.cpp index 21beedcea..df86da1bd 100644 --- a/src/modules/Telemetry/Sensor/BME680Sensor.cpp +++ b/src/modules/Telemetry/Sensor/BME680Sensor.cpp @@ -8,7 +8,7 @@ BME680Sensor::BME680Sensor() : TelemetrySensor(meshtastic_TelemetrySensorType_BM int32_t BME680Sensor::runOnce() { - LOG_INFO("Init sensor: %s\n", sensorName); + LOG_INFO("Init sensor: %s with the BSEC Library\n", sensorName); if (!hasSensor()) { return DEFAULT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS; } @@ -34,23 +34,25 @@ bool BME680Sensor::getMetrics(meshtastic_Telemetry *measurement) measurement->variant.environment_metrics.relative_humidity = bme680.humidity; measurement->variant.environment_metrics.barometric_pressure = bme680.pressure / 100.0F; measurement->variant.environment_metrics.gas_resistance = bme680.gasResistance / 1000.0; - updateState(); - // Check if we need to save state to filesystem (every STATE_SAVE_PERIOD ms) - + updateState(); return true; } void BME680Sensor::loadState() { #ifdef FSCom - if (File file = FSCom.open(bsecConfigFileName, FILE_O_READ)) { + auto file = FSCom.open(bsecConfigFileName, FILE_O_READ); + if (file) { file.read((uint8_t *)&bsecState, BSEC_MAX_STATE_BLOB_SIZE); file.close(); bme680.setState(bsecState); + LOG_INFO("%s state read from %s.\n", sensorName, bsecConfigFileName); } else { - FSCom.remove(bsecConfigFileName); + LOG_INFO("No %s state found (File: %s).\n", sensorName, bsecConfigFileName); } +#else + LOG_ERROR("ERROR: Filesystem not implemented\n"); #endif } @@ -61,12 +63,16 @@ void BME680Sensor::updateState() if (stateUpdateCounter == 0) { /* First state update when IAQ accuracy is >= 3 */ if (bme680.iaqAccuracy >= 3) { + LOG_DEBUG("%s state update IAQ accuracy %u >= 3\n", sensorName, bme680.iaqAccuracy); update = true; stateUpdateCounter++; + } else { + LOG_DEBUG("%s not updated, IAQ accuracy is %u >= 3\n", sensorName, bme680.iaqAccuracy); } } else { /* Update every STATE_SAVE_PERIOD minutes */ if ((stateUpdateCounter * STATE_SAVE_PERIOD) < millis()) { + LOG_DEBUG("%s state update every %d minutes\n", sensorName, STATE_SAVE_PERIOD); update = true; stateUpdateCounter++; } @@ -74,11 +80,25 @@ void BME680Sensor::updateState() if (update) { bme680.getState(bsecState); - if (File file = FSCom.open(bsecConfigFileName, FILE_O_WRITE)) { + std::string filenameTmp = bsecConfigFileName; + filenameTmp += ".tmp"; + auto file = FSCom.open(bsecConfigFileName, FILE_O_WRITE); + if (file) { + LOG_INFO("%s state write to %s.\n", sensorName, bsecConfigFileName); file.write((uint8_t *)&bsecState, BSEC_MAX_STATE_BLOB_SIZE); file.flush(); file.close(); + // brief window of risk here ;-) + if (FSCom.exists(bsecConfigFileName) && !FSCom.remove(bsecConfigFileName)) + LOG_WARN("Can't remove old state file\n"); + if (!renameFile(filenameTmp.c_str(), bsecConfigFileName)) + LOG_ERROR("Error: can't rename new state file\n"); + + } else { + LOG_INFO("Can't write %s state (File: %s).\n", sensorName, bsecConfigFileName); } } +#else + LOG_ERROR("ERROR: Filesystem not implemented\n"); #endif } \ No newline at end of file diff --git a/src/modules/Telemetry/Sensor/BME680Sensor.h b/src/modules/Telemetry/Sensor/BME680Sensor.h index 78adad01e..74aff835a 100644 --- a/src/modules/Telemetry/Sensor/BME680Sensor.h +++ b/src/modules/Telemetry/Sensor/BME680Sensor.h @@ -2,7 +2,7 @@ #include "TelemetrySensor.h" #include -#define STATE_SAVE_PERIOD UINT32_C(360 * 60 * 1000) +#define STATE_SAVE_PERIOD UINT32_C(360 * 60 * 1000) // That's 6 hours worth of millis() const uint8_t bsec_config_iaq[] = { #include From e0bb95ca94b85ea8c5ef91e70db192ace57e9146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Tue, 18 Apr 2023 14:22:37 +0200 Subject: [PATCH 56/56] implement dynamic userbutton overwrite. fix #2434 --- src/ButtonThread.h | 10 ++++++---- src/PowerFSM.cpp | 2 +- src/main.cpp | 14 ++++++++------ src/platform/esp32/main-esp32.cpp | 2 +- src/sleep.cpp | 6 ++++-- 5 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/ButtonThread.h b/src/ButtonThread.h index 0e9d060dc..0a8b2afa5 100644 --- a/src/ButtonThread.h +++ b/src/ButtonThread.h @@ -45,10 +45,10 @@ class ButtonThread : public concurrency::OSThread ButtonThread() : OSThread("Button") { #ifdef BUTTON_PIN - userButton = OneButton(BUTTON_PIN, true, true); + userButton = OneButton(config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN, true, true); #ifdef INPUT_PULLUP_SENSE // Some platforms (nrf52) have a SENSE variant which allows wake from sleep - override what OneButton did - pinMode(BUTTON_PIN, INPUT_PULLUP_SENSE); + pinMode(config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN, INPUT_PULLUP_SENSE); #endif userButton.attachClick(userButtonPressed); userButton.setClickTicks(300); @@ -57,7 +57,7 @@ class ButtonThread : public concurrency::OSThread userButton.attachMultiClick(userButtonMultiPressed); userButton.attachLongPressStart(userButtonPressedLongStart); userButton.attachLongPressStop(userButtonPressedLongStop); - wakeOnIrq(BUTTON_PIN, FALLING); + wakeOnIrq(config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN, FALLING); #endif #ifdef BUTTON_PIN_ALT userButtonAlt = OneButton(BUTTON_PIN_ALT, true, true); @@ -115,7 +115,9 @@ class ButtonThread : public concurrency::OSThread { // LOG_DEBUG("press!\n"); #ifdef BUTTON_PIN - if ((BUTTON_PIN != moduleConfig.canned_message.inputbroker_pin_press) || !moduleConfig.canned_message.enabled) { + if (((config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN) != + moduleConfig.canned_message.inputbroker_pin_press) || + !moduleConfig.canned_message.enabled) { powerFSM.trigger(EVENT_PRESS); } #endif diff --git a/src/PowerFSM.cpp b/src/PowerFSM.cpp index e6ebdcc93..7babc2067 100644 --- a/src/PowerFSM.cpp +++ b/src/PowerFSM.cpp @@ -99,7 +99,7 @@ static void lsIdle() LOG_INFO("wakeCause2 %d\n", wakeCause2); #ifdef BUTTON_PIN - bool pressed = !digitalRead(BUTTON_PIN); + bool pressed = !digitalRead(config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN); #else bool pressed = false; #endif diff --git a/src/main.cpp b/src/main.cpp index 53ed53b9d..7af41116c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -218,10 +218,10 @@ void setup() // If the button is connected to GPIO 12, don't enable the ability to use // meshtasticAdmin on the device. - pinMode(BUTTON_PIN, INPUT); + pinMode(config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN, INPUT); #ifdef BUTTON_NEED_PULLUP - gpio_pullup_en((gpio_num_t)BUTTON_PIN); + gpio_pullup_en((gpio_num_t)(config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN)); delay(10); #endif @@ -389,10 +389,7 @@ void setup() // scanEInkDevice(); #endif -#if HAS_BUTTON - // Buttons & LED - buttonThread = new ButtonThread(); -#endif + // LED init #ifdef LED_PIN pinMode(LED_PIN, OUTPUT); @@ -417,6 +414,11 @@ void setup() if (config.device.role == meshtastic_Config_DeviceConfig_Role_REPEATER) router = new FloodingRouter(); +#if HAS_BUTTON + // Buttons. Moved here cause we need NodeDB to be initialized + buttonThread = new ButtonThread(); +#endif + playStartMelody(); // fixed screen override? diff --git a/src/platform/esp32/main-esp32.cpp b/src/platform/esp32/main-esp32.cpp index 2068025c2..4cb7f4443 100644 --- a/src/platform/esp32/main-esp32.cpp +++ b/src/platform/esp32/main-esp32.cpp @@ -202,7 +202,7 @@ void cpuDeepSleep(uint32_t msecToWake) #ifdef BUTTON_PIN // Only GPIOs which are have RTC functionality can be used in this bit map: 0,2,4,12-15,25-27,32-39. #if SOC_RTCIO_HOLD_SUPPORTED - uint64_t gpioMask = (1ULL << BUTTON_PIN); + uint64_t gpioMask = (1ULL << config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN); #endif #ifdef BUTTON_NEED_PULLUP diff --git a/src/sleep.cpp b/src/sleep.cpp index 9468b7d09..c25e3473e 100644 --- a/src/sleep.cpp +++ b/src/sleep.cpp @@ -309,7 +309,8 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r // assert(esp_sleep_enable_uart_wakeup(0) == ESP_OK); #endif #ifdef BUTTON_PIN - esp_sleep_enable_ext0_wakeup((gpio_num_t)BUTTON_PIN, LOW); // when user presses, this button goes low + esp_sleep_enable_ext0_wakeup((gpio_num_t)(config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN), + LOW); // when user presses, this button goes low #endif #if defined(LORA_DIO1) && (LORA_DIO1 != RADIOLIB_NC) gpio_wakeup_enable((gpio_num_t)LORA_DIO1, GPIO_INTR_HIGH_LEVEL); // SX126x/SX128x interrupt, active high @@ -338,7 +339,8 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r esp_sleep_wakeup_cause_t cause = esp_sleep_get_wakeup_cause(); #ifdef BUTTON_PIN if (cause == ESP_SLEEP_WAKEUP_GPIO) - LOG_INFO("Exit light sleep gpio: btn=%d\n", !digitalRead(BUTTON_PIN)); + LOG_INFO("Exit light sleep gpio: btn=%d\n", + !digitalRead(config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN)); #endif return cause;