1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-14 14:33:07 +01:00

convert RMC from 0183 to 2k, avoid cores

This commit is contained in:
andreas
2021-10-31 21:20:27 +01:00
parent c14ed4cfe9
commit 470dec92ad
6 changed files with 155 additions and 71 deletions

View File

@@ -48,7 +48,6 @@ void N2kDataToNMEA0183::loop() {
//*****************************************************************************
void N2kDataToNMEA0183::SendMessage(const tNMEA0183Msg &NMEA0183Msg) {
if ( pNMEA0183 != 0 ) pNMEA0183->SendMessage(NMEA0183Msg);
if ( SendNMEA0183MessageCallback != 0 ) SendNMEA0183MessageCallback(NMEA0183Msg, sourceId);
}
@@ -340,7 +339,10 @@ private:
void SendRMC()
{
long now = millis();
if (NextRMCSend <= millis() && boatData->Latitude->isValid(now))
if (NextRMCSend <= millis() &&
boatData->Latitude->isValid(now) &&
boatData->Latitude->getLastSource() == sourceId
)
{
tNMEA0183Msg NMEA0183Msg;
if (NMEA0183SetRMC(NMEA0183Msg,

View File

@@ -38,7 +38,6 @@ public:
protected:
GwLog *logger;
GwBoatData *boatData;
tNMEA0183 *pNMEA0183;
int sourceId;
tSendNMEA0183MessageCallback SendNMEA0183MessageCallback;
void SendMessage(const tNMEA0183Msg &NMEA0183Msg);