Skip to content

Commit 80d64d9

Browse files
authored
Sparkfun library update: prevent false leap-year
sparkfun/SparkFun_u-blox_GNSS_Arduino_Library#125 was reported and a correction was proposed.
1 parent 655136e commit 80d64d9

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

version1_3development/lib/SparkFun_u-blox_GNSS/src/SparkFun_u-blox_GNSS_Arduino_Library.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,11 +539,20 @@ typedef struct
539539
bool moduleQueried;
540540
} moduleSWVersion_t;
541541

542+
// const uint16_t DAYS_SINCE_MONTH[4][16] =
543+
// {
544+
// { 0, 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 335, 335, 335 },
545+
// { 0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 334, 334, 334 },
546+
// { 0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 334, 334, 334 },
547+
// { 0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 334, 334, 334 },
548+
// };
549+
// LEAPYEAR BUG trial solve 20220304
542550
const uint16_t DAYS_SINCE_MONTH[4][16] =
543551
{
544-
{ 0, 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 335, 335, 335 },
552+
545553
{ 0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 334, 334, 334 },
546554
{ 0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 334, 334, 334 },
555+
{ 0, 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 335, 335, 335 },
547556
{ 0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 334, 334, 334 },
548557
};
549558

0 commit comments

Comments
 (0)