m5stack / TimerCam-arduino

TimerCam Arduino Library
MIT License
45 stars 25 forks source link

bmm8563.c Date Error #7

Closed jdr-sensen closed 2 years ago

jdr-sensen commented 2 years ago

In bmm8563_getTime, the filter for the month register seems to be incorrect, it is currently: data->month = BCD2Byte(time_buf[5] & 0x0f);

However, this causes months larger than 9 to have some of the data lost, e.g. 10->0, 11->1, 12->2

I believe the intended filter is: data->month = BCD2Byte(time_buf[5] & 0x1f);

Tinyu-Zhao commented 2 years ago

Thank you for your help!