This commit is contained in:
Mark Qvist 2024-09-29 03:10:32 +02:00
parent a4ecc0d6f3
commit 59e1836975
5 changed files with 32 additions and 26 deletions

View File

@ -20,7 +20,7 @@
#define CONFIG_H #define CONFIG_H
#define MAJ_VERS 0x01 #define MAJ_VERS 0x01
#define MIN_VERS 0x4a #define MIN_VERS 0x4b
#define MODE_HOST 0x11 #define MODE_HOST 0x11
#define MODE_TNC 0x12 #define MODE_TNC 0x12

View File

@ -175,8 +175,8 @@ upload-rnode_ng_21:
arduino-cli upload -p /dev/ttyACM0 --fqbn esp32:esp32:ttgo-lora32 arduino-cli upload -p /dev/ttyACM0 --fqbn esp32:esp32:ttgo-lora32
@sleep 1 @sleep 1
rnodeconf /dev/ttyACM0 --firmware-hash $$(./partition_hashes ./build/esp32.esp32.ttgo-lora32/RNode_Firmware.ino.bin) rnodeconf /dev/ttyACM0 --firmware-hash $$(./partition_hashes ./build/esp32.esp32.ttgo-lora32/RNode_Firmware.ino.bin)
#@sleep 3 @sleep 3
#python ./Release/esptool/esptool.py --chip esp32 --port /dev/ttyACM0 --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 --port /dev/ttyACM0 --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-t3s3: upload-t3s3:
@echo @echo

View File

@ -1372,23 +1372,25 @@ void sleep_now() {
} }
void button_event(uint8_t event, unsigned long duration) { void button_event(uint8_t event, unsigned long duration) {
display_unblank(); #if MCU_VARIANT == MCU_ESP32
if (duration > 6000) { display_unblank();
bt_enable_pairing(); if (duration > 6000) {
} else if (duration > 4000) { bt_enable_pairing();
#if HAS_CONSOLE } else if (duration > 4000) {
console_active = true; #if HAS_CONSOLE
console_start(); console_active = true;
#endif console_start();
} else if (duration > 2000) { #endif
sleep_now(); } else if (duration > 2000) {
} else { sleep_now();
if (bt_state == BT_STATE_OFF) {
bt_start();
} else { } else {
bt_stop(); if (bt_state == BT_STATE_OFF) {
bt_start();
} else {
bt_stop();
}
} }
} #endif
} }
volatile bool serial_polling = false; volatile bool serial_polling = false;

Binary file not shown.

View File

@ -49,6 +49,8 @@ uint8_t eeprom_read(uint32_t mapped_addr);
#if HAS_DISPLAY == true #if HAS_DISPLAY == true
#include "Display.h" #include "Display.h"
#else
void display_unblank() {}
#endif #endif
#if HAS_BLUETOOTH == true || HAS_BLE == true #if HAS_BLUETOOTH == true || HAS_BLE == true
@ -1439,14 +1441,16 @@ void da_conf_save(uint8_t dadr) {
} }
void db_conf_save(uint8_t val) { void db_conf_save(uint8_t val) {
if (val == 0x00) { #if HAS_DISPLAY
display_blanking_enabled = false; if (val == 0x00) {
} else { display_blanking_enabled = false;
display_blanking_enabled = true; } else {
display_blanking_timeout = val*1000; display_blanking_enabled = true;
} display_blanking_timeout = val*1000;
eeprom_update(eeprom_addr(ADDR_CONF_BSET), CONF_OK_BYTE); }
eeprom_update(eeprom_addr(ADDR_CONF_DBLK), val); eeprom_update(eeprom_addr(ADDR_CONF_BSET), CONF_OK_BYTE);
eeprom_update(eeprom_addr(ADDR_CONF_DBLK), val);
#endif
} }
void np_int_conf_save(uint8_t p_int) { void np_int_conf_save(uint8_t p_int) {