@@ -53,7 +53,7 @@ SFE_UBLOX_GNSS::SFE_UBLOX_GNSS(void)
53
53
}
54
54
55
55
// Stop all automatic message processing. Free all used RAM
56
- boolean SFE_UBLOX_GNSS::end (void )
56
+ void SFE_UBLOX_GNSS::end (void )
57
57
{
58
58
// Note: payloadCfg is not deleted
59
59
@@ -9283,12 +9283,12 @@ uint32_t SFE_UBLOX_GNSS::getUnixEpoch(uint16_t maxWait)
9283
9283
packetUBXNAVPVT->moduleQueried .moduleQueried1 .bits .sec = false ;
9284
9284
packetUBXNAVPVT->moduleQueried .moduleQueried1 .bits .all = false ;
9285
9285
// assemble time elements into time_t - credits to Thomas Roell @ https://github.com/GrumpyOldPizza
9286
- uint32_t t = (uint32_t ) (((((((packetUBXNAVPVT->data .year - 1970 ) * 365 ) + (((packetUBXNAVPVT->data .year - 1970 ) + 3 ) / 4 )) +
9287
- DAYS_SINCE_MONTH[(packetUBXNAVPVT->data .year - 1970 ) & 3 ][packetUBXNAVPVT->data .month ] +
9288
- ( packetUBXNAVPVT->data .day - 1 )) * 24 +
9289
- packetUBXNAVPVT->data .hour ) * 60 +
9290
- packetUBXNAVPVT->data .min ) * 60 +
9291
- packetUBXNAVPVT->data .sec );
9286
+ uint32_t t = ((((((((uint32_t ) packetUBXNAVPVT->data .year - 1970 ) * 365 ) + (((( uint32_t ) packetUBXNAVPVT->data .year - 1970 ) + 3 ) / 4 )) +
9287
+ DAYS_SINCE_MONTH[(( uint32_t ) packetUBXNAVPVT->data .year - 1970 ) & 3 ][( uint32_t ) packetUBXNAVPVT->data .month ] +
9288
+ (( uint32_t ) packetUBXNAVPVT->data .day - 1 )) * 24 +
9289
+ ( uint32_t ) packetUBXNAVPVT->data .hour ) * 60 +
9290
+ ( uint32_t ) packetUBXNAVPVT->data .min ) * 60 +
9291
+ ( uint32_t ) packetUBXNAVPVT->data .sec );
9292
9292
return t;
9293
9293
}
9294
9294
@@ -9310,12 +9310,12 @@ uint32_t SFE_UBLOX_GNSS::getUnixEpoch(uint32_t& microsecond, uint16_t maxWait)
9310
9310
packetUBXNAVPVT->moduleQueried .moduleQueried1 .bits .nano = false ;
9311
9311
packetUBXNAVPVT->moduleQueried .moduleQueried1 .bits .all = false ;
9312
9312
// assemble time elements into time_t - credits to Thomas Roell @ https://github.com/GrumpyOldPizza
9313
- uint32_t t = (uint32_t ) (((((((packetUBXNAVPVT->data .year - 1970 ) * 365 ) + (((packetUBXNAVPVT->data .year - 1970 ) + 3 ) / 4 )) +
9314
- DAYS_SINCE_MONTH[(packetUBXNAVPVT->data .year - 1970 ) & 3 ][packetUBXNAVPVT->data .month ] +
9315
- ( packetUBXNAVPVT->data .day - 1 )) * 24 +
9316
- packetUBXNAVPVT->data .hour ) * 60 +
9317
- packetUBXNAVPVT->data .min ) * 60 +
9318
- packetUBXNAVPVT->data .sec );
9313
+ uint32_t t = ((((((((uint32_t ) packetUBXNAVPVT->data .year - 1970 ) * 365 ) + (((( uint32_t ) packetUBXNAVPVT->data .year - 1970 ) + 3 ) / 4 )) +
9314
+ DAYS_SINCE_MONTH[(( uint32_t ) packetUBXNAVPVT->data .year - 1970 ) & 3 ][( uint32_t ) packetUBXNAVPVT->data .month ] +
9315
+ (( uint32_t ) packetUBXNAVPVT->data .day - 1 )) * 24 +
9316
+ ( uint32_t ) packetUBXNAVPVT->data .hour ) * 60 +
9317
+ ( uint32_t ) packetUBXNAVPVT->data .min ) * 60 +
9318
+ ( uint32_t ) packetUBXNAVPVT->data .sec );
9319
9319
int32_t us = packetUBXNAVPVT->data .nano / 1000 ;
9320
9320
microsecond = (uint32_t )us;
9321
9321
// adjust t if nano is negative
0 commit comments