diff --git a/software/firmware/source/SoftRF/src/driver/RF.cpp b/software/firmware/source/SoftRF/src/driver/RF.cpp index b3d77daad..3103a7172 100644 --- a/software/firmware/source/SoftRF/src/driver/RF.cpp +++ b/software/firmware/source/SoftRF/src/driver/RF.cpp @@ -2347,6 +2347,16 @@ cppQueue PacketBuffer(sizeof(AX25Msg), 5, FIFO); void aprs_msg_callback(struct AX25Msg *msg) { AX25Msg pkg; memcpy(&pkg, msg, sizeof(AX25Msg)); + + // trim off a multiline message + for (int i = 0; i < pkg.len; i++) { + if (pkg.info[i] == '\n' || pkg.info[i] == '\r') { + pkg.info[i] = 0; + pkg.len = i; + break; + } + } + PacketBuffer.push(&pkg); } @@ -2476,6 +2486,15 @@ static void sa8x8_setup() APRS_setTail(aprs_tail); APRS_setSymbol('\''); + /* AX25 library used is not 100% ready for SSID feature yet */ + if (strlen(APRS_FromCall) > 6) { + APRS_FromCall[6] = 0; + } + + // We don't need to set the destination identifier, but + // if you want to, this is how you do it: + // APRS_setDestination("APSRF1", 0); + if (hw_info.model == SOFTRF_MODEL_HAM) { #if defined(USE_NEOPIXELBUS_LIBRARY) TWR2_Pixel.SetPixelColor(0, rx ? LED_COLOR_GREEN: LED_COLOR_BLACK); @@ -2485,10 +2504,6 @@ static void sa8x8_setup() APRS_setTxLEDCallback(sa868_Tx_LED_state); - // You don't need to set the destination identifier, but - // if you want to, this is how you do it: - // APRS_setDestination("APZMDM", 0); - if (rx) { AFSK_TimerEnable(true); } diff --git a/software/firmware/source/SoftRF/src/platform/ESP32.cpp b/software/firmware/source/SoftRF/src/platform/ESP32.cpp index 52567626e..72a88d94c 100644 --- a/software/firmware/source/SoftRF/src/platform/ESP32.cpp +++ b/software/firmware/source/SoftRF/src/platform/ESP32.cpp @@ -467,6 +467,7 @@ static void ESP32_setup() * TTGO T22 V06 | | WINBOND_NEX_W25Q32_V * TTGO T22 V08 | | WINBOND_NEX_W25Q32_V * TTGO T22 V11 | | BOYA_BY25Q32AL + * TTGO T22 V12 | | WINBOND_NEX_W25Q32_V * TTGO T8 V1.8 | WROVER | GIGADEVICE_GD25LQ32 * TTGO T8 S2 V1.1 | | WINBOND_NEX_W25Q32_V * TTGO T5S V1.9 | | WINBOND_NEX_W25Q32_V @@ -1472,6 +1473,7 @@ static void ESP32_setup() CALIBRATE_ONE(RTC_CAL_32K_XTAL); if (rtc_clk_slow_freq_get() != RTC_SLOW_FREQ_32K_XTAL) { DEBUG_X32K("Warning: Failed to switch RTC clock source onto 32768 Hz XTAL !"); + rtc_clk_32k_enable(false); } else { ESP32_has_32k_xtal = true; } @@ -1485,15 +1487,16 @@ static void ESP32_setup() digitalWrite(SOC_GPIO_PIN_HELTRK_TFT_EN, LOW); digitalWrite(SOC_GPIO_PIN_HELTRK_VEXT_EN, LOW); + pinMode(SOC_GPIO_PIN_HELTRK_GNSS_EN, INPUT_PULLDOWN); + delay(300); pinMode(SOC_GPIO_PIN_HELTRK_GNSS_EN, OUTPUT); pinMode(SOC_GPIO_PIN_HELTRK_TFT_EN, OUTPUT); pinMode(SOC_GPIO_PIN_HELTRK_VEXT_EN, OUTPUT); } - digitalWrite(SOC_GPIO_PIN_HELTRK_GNSS_RST, LOW); - pinMode(SOC_GPIO_PIN_HELTRK_GNSS_RST, OUTPUT); + pinMode(SOC_GPIO_PIN_HELTRK_GNSS_RST, INPUT_PULLDOWN); delay(100); - digitalWrite(SOC_GPIO_PIN_HELTRK_GNSS_RST, HIGH); + pinMode(SOC_GPIO_PIN_HELTRK_GNSS_RST, INPUT_PULLUP); pinMode(SOC_GPIO_PIN_HELTRK_ADC_EN, INPUT_PULLUP); @@ -1927,10 +1930,10 @@ static void ESP32_loop() } #endif /* !EXCLUDE_MAG */ - if (esp32_board == ESP32_HELTEC_TRACKER) { - digitalWrite(SOC_GPIO_PIN_HELTRK_LED, - digitalRead(SOC_GPIO_PIN_HELTRK_GNSS_PPS)); - } +// if (esp32_board == ESP32_HELTEC_TRACKER) { +// digitalWrite(SOC_GPIO_PIN_HELTRK_LED, +// digitalRead(SOC_GPIO_PIN_HELTRK_GNSS_PPS)); +// } #endif /* CONFIG_IDF_TARGET_ESP32S3 */ } @@ -2689,14 +2692,14 @@ static void ESP32_EEPROM_extension(int cmd) JsonVariant fromcall = root["fromcall"]; if (fromcall.success()) { const char * fromcall_s = fromcall.as(); - if (strlen(fromcall_s) <= 6) { + if (strlen(fromcall_s) < sizeof(APRS_FromCall)) { strncpy(APRS_FromCall, fromcall_s, sizeof(APRS_FromCall)); } } JsonVariant tocall = root["tocall"]; if (tocall.success()) { const char * tocall_s = tocall.as(); - if (strlen(tocall_s) <= 6) { + if (strlen(tocall_s) < sizeof(APRS_ToCall)) { strncpy(APRS_ToCall, tocall_s, sizeof(APRS_ToCall)); } } diff --git a/software/firmware/source/SoftRF/src/platform/ESP32.h b/software/firmware/source/SoftRF/src/platform/ESP32.h index e6c0010fc..bcf7cdb61 100644 --- a/software/firmware/source/SoftRF/src/platform/ESP32.h +++ b/software/firmware/source/SoftRF/src/platform/ESP32.h @@ -131,7 +131,9 @@ extern Adafruit_NeoPixel strip; #error "This ESP32 family build variant is not supported!" #endif -#define SOC_GPIO_PIN_STATUS (hw_info.model != SOFTRF_MODEL_PRIME_MK2 ?\ +#define SOC_GPIO_PIN_STATUS (hw_info.model == SOFTRF_MODEL_MIDI ?\ + SOC_GPIO_PIN_HELTRK_LED : \ + hw_info.model != SOFTRF_MODEL_PRIME_MK2 ?\ SOC_UNUSED_PIN : \ (hw_info.revision == 2 ? \ SOC_GPIO_PIN_TBEAM_LED_V02 : \ diff --git a/software/firmware/source/SoftRF/src/platform/RP2040.cpp b/software/firmware/source/SoftRF/src/platform/RP2040.cpp index 4af97fba2..7f4e55a07 100644 --- a/software/firmware/source/SoftRF/src/platform/RP2040.cpp +++ b/software/firmware/source/SoftRF/src/platform/RP2040.cpp @@ -751,14 +751,14 @@ static void RP2040_EEPROM_extension(int cmd) JsonVariant fromcall = root["fromcall"]; if (fromcall.success()) { const char * fromcall_s = fromcall.as(); - if (strlen(fromcall_s) <= 6) { + if (strlen(fromcall_s) < sizeof(APRS_FromCall)) { strncpy(APRS_FromCall, fromcall_s, sizeof(APRS_FromCall)); } } JsonVariant tocall = root["tocall"]; if (tocall.success()) { const char * tocall_s = tocall.as(); - if (strlen(tocall_s) <= 6) { + if (strlen(tocall_s) < sizeof(APRS_ToCall)) { strncpy(APRS_ToCall, tocall_s, sizeof(APRS_ToCall)); } } diff --git a/software/firmware/source/SoftRF/src/platform/nRF52.cpp b/software/firmware/source/SoftRF/src/platform/nRF52.cpp index 727116c81..ff3bf57ba 100644 --- a/software/firmware/source/SoftRF/src/platform/nRF52.cpp +++ b/software/firmware/source/SoftRF/src/platform/nRF52.cpp @@ -1210,14 +1210,14 @@ static void nRF52_EEPROM_extension(int cmd) JsonVariant fromcall = root["fromcall"]; if (fromcall.success()) { const char * fromcall_s = fromcall.as(); - if (strlen(fromcall_s) <= 6) { + if (strlen(fromcall_s) < sizeof(APRS_FromCall)) { strncpy(APRS_FromCall, fromcall_s, sizeof(APRS_FromCall)); } } JsonVariant tocall = root["tocall"]; if (tocall.success()) { const char * tocall_s = tocall.as(); - if (strlen(tocall_s) <= 6) { + if (strlen(tocall_s) < sizeof(APRS_ToCall)) { strncpy(APRS_ToCall, tocall_s, sizeof(APRS_ToCall)); } } diff --git a/software/firmware/source/SoftRF/src/protocol/radio/APRS.cpp b/software/firmware/source/SoftRF/src/protocol/radio/APRS.cpp index 8bc732471..63f164209 100644 --- a/software/firmware/source/SoftRF/src/protocol/radio/APRS.cpp +++ b/software/firmware/source/SoftRF/src/protocol/radio/APRS.cpp @@ -116,8 +116,8 @@ extern AX25Msg Incoming_APRS_Packet; struct pbuf_t aprs; ParseAPRS aprsParse; -char APRS_FromCall[7] = ""; -char APRS_ToCall [7] = "OGFLR"; // TODO: make use of assigned APSRFx value +char APRS_FromCall[10] = ""; +char APRS_ToCall [ 7] = "OGFLR"; // TODO: make use of assigned APSRFx value int packet2Raw(String &tnc2, AX25Msg &Packet) { if (Packet.len < 5) return 0; diff --git a/software/firmware/source/SoftRF/src/protocol/radio/APRS.h b/software/firmware/source/SoftRF/src/protocol/radio/APRS.h index c424c99e3..36595417c 100644 --- a/software/firmware/source/SoftRF/src/protocol/radio/APRS.h +++ b/software/firmware/source/SoftRF/src/protocol/radio/APRS.h @@ -61,7 +61,7 @@ size_t aprs_encode(void *, ufo_t *); extern const rf_proto_desc_t prol_proto_desc; -extern char APRS_FromCall[7]; -extern char APRS_ToCall [7]; +extern char APRS_FromCall[10]; +extern char APRS_ToCall [ 7]; #endif /* PROTOCOL_APRS_H */