Waveshare ESP32 S3 Pico with SX1278 now works.
This commit is contained in:
@@ -106,6 +106,11 @@
|
|||||||
#define ERROR_MEMORY_LOW 0x05
|
#define ERROR_MEMORY_LOW 0x05
|
||||||
#define ERROR_MODEM_TIMEOUT 0x06
|
#define ERROR_MODEM_TIMEOUT 0x06
|
||||||
|
|
||||||
|
#define CMD_GPS 0xA0
|
||||||
|
|
||||||
|
#define GPS_CMD_LAT 0x00
|
||||||
|
#define GPS_CMD_LNG 0x01
|
||||||
|
|
||||||
// Serial logging
|
// Serial logging
|
||||||
#define LOG_MSG 0x2F
|
#define LOG_MSG 0x2F
|
||||||
|
|
||||||
|
@@ -46,7 +46,7 @@
|
|||||||
SPIClass interface_spi[1] = {
|
SPIClass interface_spi[1] = {
|
||||||
// SX1262
|
// SX1262
|
||||||
SPIClass(
|
SPIClass(
|
||||||
NRF_SPIM3,
|
NRF_SPIM1,
|
||||||
interface_pins[0][3],
|
interface_pins[0][3],
|
||||||
interface_pins[0][1],
|
interface_pins[0][1],
|
||||||
interface_pins[0][2]
|
interface_pins[0][2]
|
||||||
@@ -132,8 +132,14 @@ void setup() {
|
|||||||
pinMode(PIN_LED_GREEN, OUTPUT);
|
pinMode(PIN_LED_GREEN, OUTPUT);
|
||||||
pinMode(PIN_LED_BLUE, OUTPUT);
|
pinMode(PIN_LED_BLUE, OUTPUT);
|
||||||
delay(200);
|
delay(200);
|
||||||
|
#elif BOARD_MODEL == BOARD_HELTEC_T114
|
||||||
|
delay(200);
|
||||||
|
pinMode(PIN_VEXT_EN, OUTPUT);
|
||||||
|
digitalWrite(PIN_VEXT_EN, HIGH);
|
||||||
|
delay(100);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
if (!eeprom_begin()) { Serial.write("EEPROM initialisation failed.\r\n"); }
|
if (!eeprom_begin()) { Serial.write("EEPROM initialisation failed.\r\n"); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -208,6 +214,11 @@ void setup() {
|
|||||||
|
|
||||||
fifo_init(&packet_rdy_interfaces, packet_rdy_interfaces_buf, MAX_INTERFACES);
|
fifo_init(&packet_rdy_interfaces, packet_rdy_interfaces_buf, MAX_INTERFACES);
|
||||||
|
|
||||||
|
#if HAS_GPS
|
||||||
|
// init GPS
|
||||||
|
gps_s.begin(GPS_BAUD_RATE);
|
||||||
|
#endif
|
||||||
|
|
||||||
// add call to init_channel_stats here? \todo
|
// add call to init_channel_stats here? \todo
|
||||||
|
|
||||||
// Create and configure interface objects
|
// Create and configure interface objects
|
||||||
@@ -1545,7 +1556,7 @@ void loop() {
|
|||||||
process_serial();
|
process_serial();
|
||||||
|
|
||||||
#if HAS_DISPLAY
|
#if HAS_DISPLAY
|
||||||
#if DISPLAY == OLED
|
#if DISPLAY == OLED || DISPLAY == TFT || DISPLAY == ADAFRUIT_TFT
|
||||||
if (disp_ready) update_display();
|
if (disp_ready) update_display();
|
||||||
#elif DISPLAY == EINK_BW || DISPLAY == EINK_3C
|
#elif DISPLAY == EINK_BW || DISPLAY == EINK_3C
|
||||||
// Display refreshes take so long on e-paper displays that they can disrupt
|
// Display refreshes take so long on e-paper displays that they can disrupt
|
||||||
@@ -1577,6 +1588,20 @@ void loop() {
|
|||||||
input_read();
|
input_read();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if HAS_GPS
|
||||||
|
while (gps_s.available() > 0) {
|
||||||
|
if (gps.encode(gps_s.read()) && millis() - last_gps >= GPS_INTERVAL) {
|
||||||
|
kiss_indicate_location();
|
||||||
|
last_gps = millis();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (millis() > 5000 && gps.charsProcessed() < 10) {
|
||||||
|
while (true) {
|
||||||
|
Serial.println(F("No GPS detected: check wiring."));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (memory_low) {
|
if (memory_low) {
|
||||||
#if PLATFORM == PLATFORM_ESP32
|
#if PLATFORM == PLATFORM_ESP32
|
||||||
if (esp_get_free_heap_size() < 8192) {
|
if (esp_get_free_heap_size() < 8192) {
|
||||||
|
8
src/misc/gps.h
Normal file
8
src/misc/gps.h
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#include <TinyGPSPlus.h>
|
||||||
|
#include <SoftwareSerial.h>
|
||||||
|
|
||||||
|
#define GPS_INTERVAL 5000 // ms
|
||||||
|
|
||||||
|
unsigned long last_gps = 0;
|
||||||
|
TinyGPSPlus gps;
|
||||||
|
SoftwareSerial gps_s(PIN_GPS_RX, PIN_GPS_TX);
|
Reference in New Issue
Block a user