Fix style and warnings using timer0

This commit is contained in:
Fabio Utzig 2016-04-04 19:15:45 -03:00
parent 228cc36f38
commit 0bafaa0473
2 changed files with 46 additions and 31 deletions

View File

@ -161,6 +161,9 @@ static inline systime_t st_lld_get_counter(void) {
#if NRF51_ST_USE_RTC1 == TRUE
return (systime_t)NRF_RTC1->COUNTER;
#endif
#if NRF51_ST_USE_TIMER0 == TRUE
return (systime_t)0;
#endif
}
/**
@ -183,6 +186,9 @@ static inline void st_lld_start_alarm(systime_t abstime) {
NRF_RTC1->EVENTS_COMPARE[0] = 0;
NRF_RTC1->EVTENSET = RTC_EVTENSET_COMPARE0_Msk;
#endif
#if NRF51_ST_USE_TIMER0 == TRUE
(void)abstime;
#endif
}
/**
@ -215,6 +221,9 @@ static inline void st_lld_set_alarm(systime_t abstime) {
#if NRF51_ST_USE_RTC1 == TRUE
NRF_RTC1->CC[0] = abstime;
#endif
#if NRF51_ST_USE_TIMER0 == TRUE
(void)abstime;
#endif
}
/**
@ -231,6 +240,9 @@ static inline systime_t st_lld_get_alarm(void) {
#if NRF51_ST_USE_RTC1 == TRUE
return (systime_t)NRF_RTC1->CC[0];
#endif
#if NRF51_ST_USE_TIMER0 == TRUE
return (systime_t)0;
#endif
}
/**
@ -249,6 +261,9 @@ static inline bool st_lld_is_alarm_active(void) {
#if NRF51_ST_USE_RTC1 == TRUE
return NRF_RTC1->EVTEN & RTC_EVTEN_COMPARE0_Msk;
#endif
#if NRF51_ST_USE_TIMER0 == TRUE
return false;
#endif
}
#endif /* _ST_LLD_H_ */