.end now returns void. Update getUnixEpoch so it runs correctly on the ATmega328P
This commit is contained in:
@@ -53,7 +53,7 @@ SFE_UBLOX_GNSS::SFE_UBLOX_GNSS(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Stop all automatic message processing. Free all used RAM
|
//Stop all automatic message processing. Free all used RAM
|
||||||
boolean SFE_UBLOX_GNSS::end(void)
|
void SFE_UBLOX_GNSS::end(void)
|
||||||
{
|
{
|
||||||
//Note: payloadCfg is not deleted
|
//Note: payloadCfg is not deleted
|
||||||
|
|
||||||
@@ -9283,12 +9283,12 @@ uint32_t SFE_UBLOX_GNSS::getUnixEpoch(uint16_t maxWait)
|
|||||||
packetUBXNAVPVT->moduleQueried.moduleQueried1.bits.sec = false;
|
packetUBXNAVPVT->moduleQueried.moduleQueried1.bits.sec = false;
|
||||||
packetUBXNAVPVT->moduleQueried.moduleQueried1.bits.all = false;
|
packetUBXNAVPVT->moduleQueried.moduleQueried1.bits.all = false;
|
||||||
// assemble time elements into time_t - credits to Thomas Roell @ https://github.com/GrumpyOldPizza
|
// assemble time elements into time_t - credits to Thomas Roell @ https://github.com/GrumpyOldPizza
|
||||||
uint32_t t = (uint32_t)(((((((packetUBXNAVPVT->data.year - 1970) * 365) + (((packetUBXNAVPVT->data.year - 1970) + 3) / 4)) +
|
uint32_t t = ((((((((uint32_t)packetUBXNAVPVT->data.year - 1970) * 365) + ((((uint32_t)packetUBXNAVPVT->data.year - 1970) + 3) / 4)) +
|
||||||
DAYS_SINCE_MONTH[(packetUBXNAVPVT->data.year - 1970) & 3][packetUBXNAVPVT->data.month] +
|
DAYS_SINCE_MONTH[((uint32_t)packetUBXNAVPVT->data.year - 1970) & 3][(uint32_t)packetUBXNAVPVT->data.month] +
|
||||||
(packetUBXNAVPVT->data.day - 1)) * 24 +
|
((uint32_t)packetUBXNAVPVT->data.day - 1)) * 24 +
|
||||||
packetUBXNAVPVT->data.hour) * 60 +
|
(uint32_t)packetUBXNAVPVT->data.hour) * 60 +
|
||||||
packetUBXNAVPVT->data.min) * 60 +
|
(uint32_t)packetUBXNAVPVT->data.min) * 60 +
|
||||||
packetUBXNAVPVT->data.sec);
|
(uint32_t)packetUBXNAVPVT->data.sec);
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -9310,12 +9310,12 @@ uint32_t SFE_UBLOX_GNSS::getUnixEpoch(uint32_t& microsecond, uint16_t maxWait)
|
|||||||
packetUBXNAVPVT->moduleQueried.moduleQueried1.bits.nano = false;
|
packetUBXNAVPVT->moduleQueried.moduleQueried1.bits.nano = false;
|
||||||
packetUBXNAVPVT->moduleQueried.moduleQueried1.bits.all = false;
|
packetUBXNAVPVT->moduleQueried.moduleQueried1.bits.all = false;
|
||||||
// assemble time elements into time_t - credits to Thomas Roell @ https://github.com/GrumpyOldPizza
|
// assemble time elements into time_t - credits to Thomas Roell @ https://github.com/GrumpyOldPizza
|
||||||
uint32_t t = (uint32_t)(((((((packetUBXNAVPVT->data.year - 1970) * 365) + (((packetUBXNAVPVT->data.year - 1970) + 3) / 4)) +
|
uint32_t t = ((((((((uint32_t)packetUBXNAVPVT->data.year - 1970) * 365) + ((((uint32_t)packetUBXNAVPVT->data.year - 1970) + 3) / 4)) +
|
||||||
DAYS_SINCE_MONTH[(packetUBXNAVPVT->data.year - 1970) & 3][packetUBXNAVPVT->data.month] +
|
DAYS_SINCE_MONTH[((uint32_t)packetUBXNAVPVT->data.year - 1970) & 3][(uint32_t)packetUBXNAVPVT->data.month] +
|
||||||
(packetUBXNAVPVT->data.day - 1)) * 24 +
|
((uint32_t)packetUBXNAVPVT->data.day - 1)) * 24 +
|
||||||
packetUBXNAVPVT->data.hour) * 60 +
|
(uint32_t)packetUBXNAVPVT->data.hour) * 60 +
|
||||||
packetUBXNAVPVT->data.min) * 60 +
|
(uint32_t)packetUBXNAVPVT->data.min) * 60 +
|
||||||
packetUBXNAVPVT->data.sec);
|
(uint32_t)packetUBXNAVPVT->data.sec);
|
||||||
int32_t us = packetUBXNAVPVT->data.nano / 1000;
|
int32_t us = packetUBXNAVPVT->data.nano / 1000;
|
||||||
microsecond = (uint32_t)us;
|
microsecond = (uint32_t)us;
|
||||||
// adjust t if nano is negative
|
// adjust t if nano is negative
|
||||||
|
|||||||
@@ -482,7 +482,7 @@ public:
|
|||||||
//serialPort needs to be perviously initialized to correct baud rate
|
//serialPort needs to be perviously initialized to correct baud rate
|
||||||
boolean begin(Stream &serialPort); //Returns true if module is detected
|
boolean begin(Stream &serialPort); //Returns true if module is detected
|
||||||
|
|
||||||
boolean end(void); //Stop all automatic message processing. Free all used RAM
|
void end(void); //Stop all automatic message processing. Free all used RAM
|
||||||
|
|
||||||
void setI2CpollingWait(uint8_t newPollingWait_ms); // Allow the user to change the I2C polling wait if required
|
void setI2CpollingWait(uint8_t newPollingWait_ms); // Allow the user to change the I2C polling wait if required
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user