mirror of
https://github.com/Genaker/LoraSA.git
synced 2026-05-03 03:53:01 +02:00
fix Heltec boards
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef LILYGO
|
||||
|
||||
#include "LoRaBoards.h"
|
||||
|
||||
#if defined(HAS_SDCARD)
|
||||
@@ -927,3 +929,4 @@ bool beginGPS()
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
#endif // #ifdef LILYGO
|
||||
|
||||
@@ -486,6 +486,8 @@
|
||||
|
||||
#define USING_DIO2_AS_RF_SWITCH
|
||||
|
||||
#elif defined(HELTEC)
|
||||
// just to prevent error
|
||||
#elif defined(T_BEAM_S3_BPF)
|
||||
|
||||
#ifndef USING_SX1278
|
||||
|
||||
@@ -27,6 +27,9 @@ constexpr float LO_RSSI_THRESHOLD = HI_RSSI_THRESHOLD - 66;
|
||||
|
||||
// number of samples for RSSI method
|
||||
#define SAMPLES_RSSI 12 // 21 //
|
||||
#ifdef USING_SX1280PA
|
||||
#define SAMPLES_RSSI 20
|
||||
#endif
|
||||
|
||||
struct Scan
|
||||
{
|
||||
|
||||
@@ -28,7 +28,10 @@ monitor_speed = 115200
|
||||
board_build.f_cpu = 240000000
|
||||
lib_deps =
|
||||
ropg/Heltec_ESP32_LoRa_v3@^0.9.1
|
||||
build_flags = -DHELTEC_POWER_BUTTON
|
||||
build_flags =
|
||||
-DHELTEC_POWER_BUTTON
|
||||
-DHELTEC
|
||||
|
||||
|
||||
[env:lilygo-T3S3-v1-2-sx1262]
|
||||
platform = espressif32
|
||||
@@ -88,7 +91,9 @@ board_build.f_cpu = 240000000
|
||||
board_build.flash_size = 80000000L
|
||||
lib_deps =
|
||||
ropg/Heltec_ESP32_LoRa_v3@^0.9.1
|
||||
build_flags = -DLILYGO
|
||||
build_flags =
|
||||
-DHELTEC
|
||||
-DHELTEC_POWER_BUTTON
|
||||
|
||||
[env:vision-master-e290]
|
||||
platform = espressif32
|
||||
@@ -97,7 +102,8 @@ framework = arduino
|
||||
monitor_speed = 115200
|
||||
monitor_filters = esp32_exception_decoder
|
||||
board_upload.use_1200bps_touch = true
|
||||
build_flags =
|
||||
build_flags =
|
||||
-DHELTEC
|
||||
-DHELTEC_BOARD=37
|
||||
-DSLOW_CLK_TPYE=1
|
||||
-DARDUINO_USB_CDC_ON_BOOT=1
|
||||
@@ -130,6 +136,7 @@ monitor_speed = 115200
|
||||
monitor_filters = esp32_exception_decoder
|
||||
board_upload.use_1200bps_touch = true
|
||||
build_flags =
|
||||
-DHELTEC
|
||||
-DHELTEC_BOARD=38
|
||||
-DSLOW_CLK_TPYE=1
|
||||
-DARDUINO_USB_CDC_ON_BOOT=1
|
||||
|
||||
20
src/main.cpp
20
src/main.cpp
@@ -36,22 +36,24 @@
|
||||
// library internals.
|
||||
#define RADIOLIB_GODMODE (1)
|
||||
|
||||
#include <LoRaBoards.h>
|
||||
#include <scan.h>
|
||||
|
||||
#ifndef LILYGO
|
||||
#include <heltec_unofficial.h>
|
||||
// This file contains a binary patch for the SX1262
|
||||
#include "modules/SX126x/patches/SX126x_patch_scan.h"
|
||||
#endif // end LILYGO
|
||||
#endif // end ifndef LILYGO
|
||||
|
||||
#if defined(LILYGO)
|
||||
// LiLyGO device does not support the auto download mode, you need to get into the
|
||||
// download mode manually. To do so, press and hold the BOOT button and then press the
|
||||
// RESET button once. After that release the BOOT button. Or OFF->ON together with BOOT
|
||||
|
||||
// Default LilyGO code
|
||||
#include "utilities.h"
|
||||
// Our Code
|
||||
#include <LoRaBoards.h>
|
||||
|
||||
// #include "utilities.h"
|
||||
// Our Code
|
||||
#include "LiLyGo.h"
|
||||
#endif // end LILYGO
|
||||
|
||||
@@ -134,6 +136,10 @@ uint64_t RANGE_PER_PAGE = FREQ_END - FREQ_BEGIN; // FREQ_END - FREQ_BEGIN
|
||||
// multiplies STEPS * N to increase scan resolution.
|
||||
#define SCAN_RBW_FACTOR 2
|
||||
|
||||
#ifdef USING_SX1280PA
|
||||
#define SCAN_RBW_FACTOR 2
|
||||
#endif
|
||||
|
||||
constexpr int OSD_PIXELS_PER_CHAR = (STEPS * SCAN_RBW_FACTOR) / OSD_CHART_WIDTH;
|
||||
|
||||
#define DEFAULT_RANGE_PER_PAGE 50
|
||||
@@ -423,9 +429,11 @@ void init_radio()
|
||||
|
||||
void setup(void)
|
||||
{
|
||||
#ifdef LILYGO
|
||||
setupBoards();
|
||||
delay(5000);
|
||||
Serial.println("setup is done");
|
||||
delay(3000);
|
||||
Serial.println("setup LiLyGO board is done");
|
||||
#endif
|
||||
|
||||
// LED brightness
|
||||
heltec_led(25);
|
||||
|
||||
@@ -223,7 +223,7 @@ void UI_displayDecorate(int begin = 0, int end = 0, bool redraw = false)
|
||||
display_instance->setTextAlignment(TEXT_ALIGN_CENTER);
|
||||
// clear status line
|
||||
clearStatus();
|
||||
display_instance->drawString(start_scan_text, ROW_STATUS_TEXT,
|
||||
display_instance->drawString(start_scan_text + 2, ROW_STATUS_TEXT,
|
||||
String(drone_detected_frequency_start) + ">RF<" +
|
||||
String(drone_detected_frequency_end));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user