From 33dedb202fbba66e3cd411b3217767e8f7c2d67e Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sat, 12 Apr 2025 20:59:00 +0200 Subject: [PATCH] Cleanup --- Display.h | 2 +- Framing.h | 5 +++++ Makefile | 8 ++++---- esp32_btbufs.py | 7 ++++--- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Display.h b/Display.h index 58b96c5..7062e0d 100644 --- a/Display.h +++ b/Display.h @@ -655,7 +655,7 @@ void draw_waterfall(int px, int py) { if (rssi_val > WF_RSSI_MAX) rssi_val = WF_RSSI_MAX; int rssi_normalised = ((rssi_val - WF_RSSI_MIN)*(1.0/WF_RSSI_SPAN))*WF_PIXEL_WIDTH; if (display_tx) { - for (uint8_t i; i < WF_TX_SIZE; i++) { + for (uint8_t i = 0; i < WF_TX_SIZE; i++) { waterfall[waterfall_head++] = -1; if (waterfall_head >= WATERFALL_SIZE) waterfall_head = 0; } diff --git a/Framing.h b/Framing.h index 89e1039..6dffb98 100644 --- a/Framing.h +++ b/Framing.h @@ -82,6 +82,11 @@ #define CMD_RESET 0x55 #define CMD_RESET_BYTE 0xF8 + #define CMD_LOG 0x70 + #define CMD_TIME 0x70 + #define CMD_MUX_CHAIN 0x80 + #define CMD_MUX_DSCVR 0x81 + #define DETECT_REQ 0x73 #define DETECT_RESP 0x46 diff --git a/Makefile b/Makefile index 2a244ac..13bd23b 100644 --- a/Makefile +++ b/Makefile @@ -192,11 +192,11 @@ upload-heltec32_v2: python ./Release/esptool/esptool.py --chip esp32 --port /dev/ttyUSB1 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin upload-heltec32_v3: - arduino-cli upload -p /dev/ttyUSB1 --fqbn esp32:esp32:heltec_wifi_lora_32_V3 + arduino-cli upload -p /dev/ttyUSB0 --fqbn esp32:esp32:heltec_wifi_lora_32_V3 @sleep 1 - rnodeconf /dev/ttyUSB1 --firmware-hash $$(./partition_hashes ./build/esp32.esp32.heltec_wifi_lora_32_V3/RNode_Firmware.ino.bin) + rnodeconf /dev/ttyUSB0 --firmware-hash $$(./partition_hashes ./build/esp32.esp32.heltec_wifi_lora_32_V3/RNode_Firmware.ino.bin) @sleep 3 - python ./Release/esptool/esptool.py --chip esp32-s3 --port /dev/ttyUSB1 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin + python ./Release/esptool/esptool.py --chip esp32-s3 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin upload-tdeck: arduino-cli upload -p /dev/ttyACM0 --fqbn esp32:esp32:esp32s3 @@ -357,7 +357,7 @@ release-heltec32_v2: check_bt_buffers zip --junk-paths ./Release/rnode_firmware_heltec32v2.zip ./Release/esptool/esptool.py ./Release/console_image.bin build/rnode_firmware_heltec32v2.boot_app0 build/rnode_firmware_heltec32v2.bin build/rnode_firmware_heltec32v2.bootloader build/rnode_firmware_heltec32v2.partitions rm -r build -release-heltec32_v3: +release-heltec32_v3: check_bt_buffers arduino-cli compile --fqbn esp32:esp32:heltec_wifi_lora_32_V3 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x3A\"" cp ~/.arduino15/packages/esp32/hardware/esp32/$(ARDUINO_ESP_CORE_VER)/tools/partitions/boot_app0.bin build/rnode_firmware_heltec32v3.boot_app0 cp build/esp32.esp32.heltec_wifi_lora_32_V3/RNode_Firmware.ino.bin build/rnode_firmware_heltec32v3.bin diff --git a/esp32_btbufs.py b/esp32_btbufs.py index 8a5b15e..ad0ae70 100755 --- a/esp32_btbufs.py +++ b/esp32_btbufs.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 import sys +import re try: target_path = sys.argv[1] @@ -12,7 +13,7 @@ try: for line in sf: line_index += 1 if line.startswith("#define RX_QUEUE_SIZE"): - ents = line.split(" ") + ents = re.sub(" +", " ", line).split(" ") try: rxbuf_size = int(ents[2]) rx_line_index = line_index @@ -20,12 +21,12 @@ try: print(f"Could not parse Bluetooth RX_QUEUE_SIZE: {e}") if line.startswith("#define TX_QUEUE_SIZE"): - ents = line.split(" ") + ents = re.sub(" +", " ", line).split(" ") try: txbuf_size = int(ents[2]) tx_line_index = line_index except Exception as e: - print(f"Could not parse Bluetooth RX_QUEUE_SIZE: {e}") + print(f"Could not parse Bluetooth TX_QUEUE_SIZE: {e}") if rxbuf_size != 0 and txbuf_size != 0: break