tests: drivers: counter: nrf: Convert to new dts macros

Convert to use DT_LABEL() to get the timer and rtc device name.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2020-04-30 11:50:46 -05:00 committed by Anas Nashif
parent c678f9c132
commit e13544c4aa
2 changed files with 16 additions and 16 deletions

View file

@ -29,27 +29,27 @@ struct counter_alarm_cfg alarm_cfg2;
static const char * const devices[] = {
#ifdef CONFIG_COUNTER_TIMER0
/* Nordic TIMER0 may be reserved for Bluetooth */
DT_NORDIC_NRF_TIMER_TIMER_0_LABEL,
DT_LABEL(DT_NODELABEL(timer0)),
#endif
#ifdef CONFIG_COUNTER_TIMER1
DT_NORDIC_NRF_TIMER_TIMER_1_LABEL,
DT_LABEL(DT_NODELABEL(timer1)),
#endif
#ifdef CONFIG_COUNTER_TIMER2
DT_NORDIC_NRF_TIMER_TIMER_2_LABEL,
DT_LABEL(DT_NODELABEL(timer2)),
#endif
#ifdef CONFIG_COUNTER_TIMER3
DT_NORDIC_NRF_TIMER_TIMER_3_LABEL,
DT_LABEL(DT_NODELABEL(timer3)),
#endif
#ifdef CONFIG_COUNTER_TIMER4
DT_NORDIC_NRF_TIMER_TIMER_4_LABEL,
DT_LABEL(DT_NODELABEL(timer4)),
#endif
#ifdef CONFIG_COUNTER_RTC0
/* Nordic RTC0 may be reserved for Bluetooth */
DT_NORDIC_NRF_RTC_RTC_0_LABEL,
DT_LABEL(DT_NODELABEL(rtc0)),
#endif
/* Nordic RTC1 is used for the system clock */
#ifdef CONFIG_COUNTER_RTC2
DT_NORDIC_NRF_RTC_RTC_2_LABEL,
DT_LABEL(DT_NODELABEL(rtc2)),
#endif
#if DT_HAS_NODE(DT_INST(0, nxp_imx_epit))
DT_LABEL(DT_INST(0, nxp_imx_epit)),
@ -836,43 +836,43 @@ static bool reliable_cancel_capable(const char *dev_name)
*/
#ifdef CONFIG_COUNTER_RTC0
/* Nordic RTC0 may be reserved for Bluetooth */
if (strcmp(dev_name, DT_NORDIC_NRF_RTC_RTC_0_LABEL) == 0) {
if (strcmp(dev_name, DT_LABEL(DT_NODELABEL(rtc0))) == 0) {
return true;
}
#endif
#ifdef CONFIG_COUNTER_RTC2
if (strcmp(dev_name, DT_NORDIC_NRF_RTC_RTC_2_LABEL) == 0) {
if (strcmp(dev_name, DT_LABEL(DT_NODELABEL(rtc2))) == 0) {
return true;
}
#endif
#ifdef CONFIG_COUNTER_TIMER0
if (strcmp(dev_name, DT_NORDIC_NRF_TIMER_TIMER_0_LABEL) == 0) {
if (strcmp(dev_name, DT_LABEL(DT_NODELABEL(timer0))) == 0) {
return true;
}
#endif
#ifdef CONFIG_COUNTER_TIMER1
if (strcmp(dev_name, DT_NORDIC_NRF_TIMER_TIMER_1_LABEL) == 0) {
if (strcmp(dev_name, DT_LABEL(DT_NODELABEL(timer1))) == 0) {
return true;
}
#endif
#ifdef CONFIG_COUNTER_TIMER2
if (strcmp(dev_name, DT_NORDIC_NRF_TIMER_TIMER_2_LABEL) == 0) {
if (strcmp(dev_name, DT_LABEL(DT_NODELABEL(timer2))) == 0) {
return true;
}
#endif
#ifdef CONFIG_COUNTER_TIMER3
if (strcmp(dev_name, DT_NORDIC_NRF_TIMER_TIMER_3_LABEL) == 0) {
if (strcmp(dev_name, DT_LABEL(DT_NODELABEL(timer3))) == 0) {
return true;
}
#endif
#ifdef CONFIG_COUNTER_TIMER4
if (strcmp(dev_name, DT_NORDIC_NRF_TIMER_TIMER_4_LABEL) == 0) {
if (strcmp(dev_name, DT_LABEL(DT_NODELABEL(timer4))) == 0) {
return true;
}
#endif

View file

@ -16,11 +16,11 @@ static volatile u32_t top_cnt;
const char *devices[] = {
#ifdef CONFIG_COUNTER_RTC0
/* Nordic RTC0 may be reserved for Bluetooth */
DT_NORDIC_NRF_RTC_RTC_0_LABEL,
DT_LABEL(DT_NODELABEL(rtc0)),
#endif
/* Nordic RTC1 is used for the system clock */
#ifdef CONFIG_COUNTER_RTC2
DT_NORDIC_NRF_RTC_RTC_2_LABEL,
DT_LABEL(DT_NODELABEL(rtc2)),
#endif
};