Closed vlad0x00 closed 2 years ago
Parsing __DATE__ and __TIME__ does not work right now, this PR fixes it.
Current parsing tries to parse double digits as a character which only takes the first digit. It used to work before this commit: https://github.com/NorthernWidget/DS3231/commit/c15b45025691f90caceb793480b62132886742eb But the scanf string wasn't correct before either, as it used %d for uint8_t, while %d should be used for int. The correct specifier for uint8_t would be %hhu as per https://www.cplusplus.com/reference/cstdio/scanf/
%d
uint8_t
int
%hhu
Many thanks for this improvement to the parser!
Parsing __DATE__ and __TIME__ does not work right now, this PR fixes it.
Current parsing tries to parse double digits as a character which only takes the first digit. It used to work before this commit: https://github.com/NorthernWidget/DS3231/commit/c15b45025691f90caceb793480b62132886742eb But the scanf string wasn't correct before either, as it used
%d
foruint8_t
, while%d
should be used forint
. The correct specifier foruint8_t
would be%hhu
as per https://www.cplusplus.com/reference/cstdio/scanf/