diff --git a/platformio.ini b/platformio.ini index bb897d5..5723634 100644 --- a/platformio.ini +++ b/platformio.ini @@ -259,6 +259,7 @@ build_flags = -DRADIOLIB_EXCLUDE_SX127X=true -DRADIOLIB_EXCLUDE_SX128X=true -DROTATION=1 # 1 = default; 3 = inverted + lib_deps = SPI Wire diff --git a/src/main.cpp b/src/main.cpp index c2ad7ea..8ae8a1e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1736,7 +1736,7 @@ void loop(void) scanBT(); bt_start = millis(); } -#endif #endif sideBarCol = SIDEBAR_START_COL; +#endif } diff --git a/tft_src/main.cpp b/tft_src/main.cpp index 340f88d..6b16a7f 100644 --- a/tft_src/main.cpp +++ b/tft_src/main.cpp @@ -16,9 +16,14 @@ // #include "global_config.h" #include "images.h" // #include "ui.h" -#include "comms.h" #include #include + +#ifdef SERIAL_OUT +#include +#include +#endif + #include struct Entry @@ -255,6 +260,7 @@ void setBrightness() ledcWrite(st7789_brightness_channel, current_brightness); } +#ifdef SERIAL_OUT struct frequency_scan_result { uint64_t begin; @@ -306,6 +312,7 @@ void dumpToCommsTask() m.payload.dump = frequency_scan_result.dump; Comms0->send(m); } +#endif #define battery_w 13 #define battery_h 13 @@ -480,7 +487,10 @@ constexpr unsigned int STATUS_BAR_HEIGHT = 5; void loop() { +#ifdef SERIAL_OUT checkComms(); +#endif + // Serial.println("Loop"); if (screen_update_loop_counter == 0) { @@ -574,6 +584,7 @@ void loop() st7789->drawPixel(x1, rssiToPix(rssi2) - 3, rssiToColor(abs(rssi2))); st7789->drawPixel(x1, rssiToPix(rssi2) - 4, rssiToColor(abs(rssi2))); +#ifdef SERIAL_OUT frequency_scan_result.dump.freqs_khz[frequency_scan_result.dump.sz] = (int)freq * 1000; @@ -584,6 +595,7 @@ void loop() Serial.println("frequency_scan_result overflow 10000"); } +#endif if (true /*draw full line*/) { st7789->drawFastVLine(x1, rssiToPix(rssi2), lower_level - rssiToPix(rssi2), @@ -798,10 +810,13 @@ void loop() display_scan_i_end = 0; } +#ifdef SERIAL_OUT + // Dump to Serial dumpToCommsTask(); - fr = FREQ_BEGIN; frequency_scan_result.dump.sz = 0; +#endif + fr = FREQ_BEGIN; rssi_single_start = 0; rssi_single_end = 0; x1 = 0; @@ -823,15 +838,19 @@ void loop() #endif } +#ifdef SERIAL_OUT Config config; +#endif void setup() { uint32_t *f = new uint32_t[10000]; int16_t *r = new int16_t[10000]; +#ifdef SERIAL_OUT frequency_scan_result.dump.freqs_khz = f; frequency_scan_result.dump.rssis = r; +#endif for (int i = 0; i < MAX_MHZ_INTERVAL; i++) { @@ -879,6 +898,9 @@ void setup() Serial.println(state); } heltec_setup(); + +#ifdef SERIAL_OUT + config = Config::init(); bool comms_initialized = Comms::initComms(config); if (comms_initialized) @@ -889,6 +911,8 @@ void setup() { Serial.println("Comms did not initialize"); } +#endif + delay(2000); st7789->fillScreen(ST7789_BLACK); }