Fix result index

This commit is contained in:
Egor Shitikov
2024-09-13 16:49:18 -07:00
parent 7bfa5aba9a
commit 109b71739f
2 changed files with 5 additions and 4 deletions
-4
View File
@@ -25,7 +25,6 @@ monitor_speed = 115200
board_build.f_cpu = 240000000
lib_deps =
ropg/Heltec_ESP32_LoRa_v3@^0.9.1
adafruit/Adafruit ST7735 and ST7789 Library@^1.10.4
build_flags = -DHELTEC_POWER_BUTTON
[env:lilygo-T3S3-v1-2]
@@ -38,7 +37,6 @@ board_build.f_cpu = 240000000
lib_deps =
ropg/Heltec_ESP32_LoRa_v3@^0.9.1
RadioLib
adafruit/Adafruit ST7735 and ST7789 Library@^1.10.4
build_flags =
-DLILYGO
-DT3_S3_V1_2_SX1262
@@ -61,7 +59,6 @@ board_build.f_cpu = 240000000
board_build.flash_size = 80000000L
lib_deps =
ropg/Heltec_ESP32_LoRa_v3@^0.9.1
adafruit/Adafruit ST7735 and ST7789 Library@^1.10.4
build_flags = -DLILYGO
[env:vision-master-e290]
@@ -95,7 +92,6 @@ lib_deps =
https://github.com/HelTecAutomation/Heltec_ESP32/
adafruit/Adafruit GFX Library@^1.11.10
ropg/Heltec_ESP32_LoRa_v3@^0.9.1
adafruit/Adafruit ST7735 and ST7789 Library@^1.10.4
[env:vision-master-t190]
platform = espressif32
+5
View File
@@ -948,6 +948,11 @@ void loop(void)
// I like this formula better
result_index = uint8_t(abs(rssi) / 2) - 22;
}
if (result_index >= RADIOLIB_SX126X_SPECTRAL_SCAN_RES_SIZE)
{
// Maximum index possible
result_index = RADIOLIB_SX126X_SPECTRAL_SCAN_RES_SIZE - 1;
}
#ifdef PRINT_DEBUG
Serial.printf("RSSI: %d IDX: %d\n", rssi, result_index);