Hey Nice to see it
I was thinking of pulling the RTC in from the from the framework.
Code comment review.
There is a potential hiccup. When reading hardware registers and operating on them I always make one good local read/copy of the hardware register and then operate on the same value. So in
return (((current_time() & 0x00300000) >> 20) * 10 + ((current_time() & 0x000F0000) >> 16));
converting from BCD to std number the "current_time()" is called twice and each time reads from the hardware registers. With the two current_time() reads they could return different readings.
Better I would think to do
uint32_t dwTimeCurrent = current_time();
return (((dwTimeCurrent & 0x00300000) >> 20) * 10 + (( dwTimeCurrent & 0x000F0000) >> 16));
Yes you are right, I will correct it, and after it I will make functions to set parts of the date seperate, but its a little bit tricky the day of the week need to be changed too. Hope I'm back soon with the alarmfunction to.
Btw. it's my first library, the last time I changed one for the Leonardo, so please be patient (I write it between work and studying) updates will follow soon.