rtc_dcf77: minor, add space around operators

This commit is contained in:
King Kévin 2020-02-17 15:16:04 +01:00
parent 48bc700ed7
commit 4b2e43a94b
2 changed files with 48 additions and 48 deletions

View File

@ -12,10 +12,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/** library to get time from a DCF77 module (code)
* @file rtc_dcf77.c
/** library to get time from a DCF77 module
* @file
* @author King Kévin <kingkevin@cuvoodoo.info>
* @date 2016-2017
* @date 2016-2020
* @note peripherals used: GPIO @ref rtc_dcf77_gpio, timer @ref rtc_dcf77_timer
*/
@ -130,14 +130,14 @@ static void rtc_dcf77_decode(void)
if (rtc_dcf77_frame == 0) { // no time received yet
return;
}
if (!(rtc_dcf77_frame&((uint64_t)1<<20))) { // start of encoded time should always be 1
if (!(rtc_dcf77_frame & (1ULL << 20))) { // start of encoded time should always be 1
return;
}
// check minute parity
uint8_t parity = 0; // to check parity
for (uint8_t bit = 21; bit <= 28; bit++) {
if (rtc_dcf77_frame&((uint64_t)1<<bit)) {
if (rtc_dcf77_frame & (1ULL << bit)) {
parity++; // count the set bits
}
}
@ -152,7 +152,7 @@ static void rtc_dcf77_decode(void)
// check hour parity
parity = 0;
for (uint8_t bit = 29; bit <= 35; bit++) {
if (rtc_dcf77_frame&((uint64_t)1<<bit)) {
if (rtc_dcf77_frame & (1ULL << bit)) {
parity++; // count the set bits
}
}
@ -167,7 +167,7 @@ static void rtc_dcf77_decode(void)
// check date parity
parity = 0;
for (uint8_t bit = 36; bit <= 58; bit++) {
if (rtc_dcf77_frame&((uint64_t)1<<bit)) {
if (rtc_dcf77_frame & (1ULL << bit)) {
parity++; // count the set bits
}
}

View File

@ -12,10 +12,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/** library to get time from a DCF77 module (API)
* @file rtc_dcf77.h
/** library to get time from a DCF77 module
* @file
* @author King Kévin <kingkevin@cuvoodoo.info>
* @date 2016-2017
* @date 2016-2020
* @note peripherals used: GPIO @ref rtc_dcf77_gpio, timer @ref rtc_dcf77_timer
*/
#pragma once