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 MAJ_VERS 0x01
#define MIN_VERS 0x4a
#define MIN_VERS 0x4b
#define MODE_HOST 0x11
#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
@sleep 1
rnodeconf /dev/ttyACM0 --firmware-hash $$(./partition_hashes ./build/esp32.esp32.ttgo-lora32/RNode_Firmware.ino.bin)
#@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
@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
upload-t3s3:
@echo

View File

@ -1372,23 +1372,25 @@ void sleep_now() {
}
void button_event(uint8_t event, unsigned long duration) {
display_unblank();
if (duration > 6000) {
bt_enable_pairing();
} else if (duration > 4000) {
#if HAS_CONSOLE
console_active = true;
console_start();
#endif
} else if (duration > 2000) {
sleep_now();
} else {
if (bt_state == BT_STATE_OFF) {
bt_start();
#if MCU_VARIANT == MCU_ESP32
display_unblank();
if (duration > 6000) {
bt_enable_pairing();
} else if (duration > 4000) {
#if HAS_CONSOLE
console_active = true;
console_start();
#endif
} else if (duration > 2000) {
sleep_now();
} else {
bt_stop();
if (bt_state == BT_STATE_OFF) {
bt_start();
} else {
bt_stop();
}
}
}
#endif
}
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
#include "Display.h"
#else
void display_unblank() {}
#endif
#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) {
if (val == 0x00) {
display_blanking_enabled = false;
} else {
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);
#if HAS_DISPLAY
if (val == 0x00) {
display_blanking_enabled = false;
} else {
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);
#endif
}
void np_int_conf_save(uint8_t p_int) {