Some fixes

This commit is contained in:
Egor
2025-01-08 16:32:43 -08:00
parent 51cd2ea9c9
commit fbc20eeb45
6 changed files with 11 additions and 5 deletions

View File

@@ -140,7 +140,8 @@ def draw_histogram(stdscr, data, histogram_start_row, db_threshold, db_per_hash,
# Clear the histogram area
clear_histogram_area(stdscr, histogram_start_row, 15, max_width)
baseline_row = histogram_start_row + 12 # Set the baseline for bars
histogram_height = 20
baseline_row = histogram_start_row + histogram_height # Set the baseline for bars
legend_start = baseline_row + 1 # Legends go below the baseline
# Calculate maximum bar height
@@ -259,6 +260,9 @@ def read_serial_data(stdscr, port, baudrate, resolution_mhz, db_threshold, db_pe
use_color,
show_debug
)
elif response.startswith("LORA_RSSI"):
stdscr.addstr(0, 0, " ", curses.color_pair(1))
stdscr.addstr(0, 0, response + "dB", curses.color_pair(1))
else:
stdscr.refresh()
except serial.SerialException as e:

View File

@@ -83,7 +83,6 @@ struct Endpoint
{
union
{
struct
{
uint8_t loop : 1, // self

View File

@@ -385,7 +385,7 @@ Message *RadioComms::receive(uint16_t timeout_ms)
radio.clearDio1Action();
packetRssi = radio.getRSSI(true);
Serial.println("Lora Last Packet RSSI:" + String(packetRssi));
Serial.println("LORA_RSSI: " + String(packetRssi));
size_t len = radio.getPacketLength(true);
uint8_t *packet = msg;

View File

@@ -535,7 +535,7 @@ String Config::getConfig(String key)
{
return listen_on_usb;
}
// Example: SET detection_strategy RSSI_MAX 900000..950000+390
if (key.equalsIgnoreCase("detection_strategy"))
{
return detectionStrategyToStr(*this);

View File

@@ -50,6 +50,7 @@ lib_deps =
build_flags =
-DHELTEC_POWER_BUTTON
-DHELTEC
-DSAMPLES_RSSI=5
-DARDUINO_USB_CDC_ON_BOOT=1
-DARDUINO_USB_MODE=1
-DDEFAULT_RX=916

View File

@@ -238,6 +238,8 @@ uint64_t drone_detected_frequency_start = 0;
uint64_t drone_detected_frequency_end = 0;
bool single_page_scan = false;
float vbat = 0;
// #define PRINT_DEBUG
#define PRINT_PROFILE_TIME
@@ -1133,7 +1135,7 @@ void setup(void)
osd.displayString(14, 15, " Lora SA");
osd.displayString(2, 1, " Spectral RF Analyzer");
#endif
float vbat;
float resolution;
bt_start = millis();
wf_start = millis();