mirror of https://github.com/arendst/Tasmota.git
adapt GPS-stuff for ESP32
This commit is contained in:
parent
16ca5cb103
commit
5588d1dda0
|
@ -87,7 +87,7 @@ bool NtpServer::processOneRequest(uint32_t utc, uint32_t millisecs)
|
||||||
packet.swapEndian();
|
packet.swapEndian();
|
||||||
|
|
||||||
timeServerPort_.beginPacket(timeServerPort_.remoteIP(), timeServerPort_.remotePort());
|
timeServerPort_.beginPacket(timeServerPort_.remoteIP(), timeServerPort_.remotePort());
|
||||||
timeServerPort_.write(packet.packet(), NtpPacket::PACKET_SIZE);
|
timeServerPort_.write((const uint8_t *)packet.packet(), NtpPacket::PACKET_SIZE);
|
||||||
timeServerPort_.endPacket();
|
timeServerPort_.endPacket();
|
||||||
|
|
||||||
processed = true;
|
processed = true;
|
||||||
|
|
|
@ -102,4 +102,3 @@ lib_ignore =
|
||||||
ILI9488
|
ILI9488
|
||||||
SSD3115
|
SSD3115
|
||||||
cc1101
|
cc1101
|
||||||
ArduinoNTPd
|
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
\*********************************************************************************************/
|
\*********************************************************************************************/
|
||||||
|
|
||||||
#ifdef USE_FLOG
|
#ifdef USE_FLOG
|
||||||
|
#ifdef ESP8266
|
||||||
|
|
||||||
class FLOG
|
class FLOG
|
||||||
|
|
||||||
|
@ -429,4 +430,5 @@ void FLOG::stopRecording(void){
|
||||||
_initBuffer();
|
_initBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // ESP8266
|
||||||
#endif // USE_FLOG
|
#endif // USE_FLOG
|
|
@ -18,6 +18,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef USE_GPS
|
#ifdef USE_GPS
|
||||||
|
#if defined(ESP32) && defined(USE_FLOG)
|
||||||
|
#undef USE_FLOG
|
||||||
|
#warning FLOG deactivated on ESP32
|
||||||
|
#endif //ESP32
|
||||||
/*********************************************************************************************\
|
/*********************************************************************************************\
|
||||||
--------------------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------------------
|
||||||
Version Date Action Description
|
Version Date Action Description
|
||||||
|
@ -115,6 +119,10 @@ rule3 on tele-FLOG#sec do DisplayText [f0c1l4]SAV:%value% endon on tele-FLOG#r
|
||||||
#include "NTPServer.h"
|
#include "NTPServer.h"
|
||||||
#include "NTPPacket.h"
|
#include "NTPPacket.h"
|
||||||
|
|
||||||
|
#ifdef ESP32
|
||||||
|
#include <HardwareSerial.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/*********************************************************************************************\
|
/*********************************************************************************************\
|
||||||
* constants
|
* constants
|
||||||
\*********************************************************************************************/
|
\*********************************************************************************************/
|
||||||
|
@ -291,7 +299,11 @@ enum UBXMsgType {
|
||||||
#ifdef USE_FLOG
|
#ifdef USE_FLOG
|
||||||
FLOG *Flog = nullptr;
|
FLOG *Flog = nullptr;
|
||||||
#endif //USE_FLOG
|
#endif //USE_FLOG
|
||||||
|
#ifdef ESP8266
|
||||||
TasmotaSerial *UBXSerial;
|
TasmotaSerial *UBXSerial;
|
||||||
|
#else
|
||||||
|
HardwareSerial *UBXSerial;
|
||||||
|
#endif
|
||||||
|
|
||||||
NtpServer timeServer(PortUdp);
|
NtpServer timeServer(PortUdp);
|
||||||
|
|
||||||
|
@ -351,13 +363,21 @@ void UBXDetect(void)
|
||||||
{
|
{
|
||||||
UBX.mode.init = 0;
|
UBX.mode.init = 0;
|
||||||
if ((pin[GPIO_GPS_RX] < 99) && (pin[GPIO_GPS_TX] < 99)) {
|
if ((pin[GPIO_GPS_RX] < 99) && (pin[GPIO_GPS_TX] < 99)) {
|
||||||
|
#ifdef ESP8266
|
||||||
UBXSerial = new TasmotaSerial(pin[GPIO_GPS_RX], pin[GPIO_GPS_TX], 1, 0, UBX_SERIAL_BUFFER_SIZE); // 64 byte buffer is NOT enough
|
UBXSerial = new TasmotaSerial(pin[GPIO_GPS_RX], pin[GPIO_GPS_TX], 1, 0, UBX_SERIAL_BUFFER_SIZE); // 64 byte buffer is NOT enough
|
||||||
if (UBXSerial->begin(9600)) {
|
if (UBXSerial->begin(9600)) {
|
||||||
|
#else
|
||||||
|
UBXSerial = new HardwareSerial(2);
|
||||||
|
UBXSerial->begin(9600,SERIAL_8N1,pin[GPIO_GPS_RX], pin[GPIO_GPS_TX]);
|
||||||
|
{
|
||||||
|
#endif
|
||||||
DEBUG_SENSOR_LOG(PSTR("UBX: started serial"));
|
DEBUG_SENSOR_LOG(PSTR("UBX: started serial"));
|
||||||
|
#ifdef ESP8266
|
||||||
if (UBXSerial->hardwareSerial()) {
|
if (UBXSerial->hardwareSerial()) {
|
||||||
ClaimSerial();
|
ClaimSerial();
|
||||||
DEBUG_SENSOR_LOG(PSTR("UBX: claim HW"));
|
DEBUG_SENSOR_LOG(PSTR("UBX: claim HW"));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in New Issue