Skip to content
Permalink
Browse files

samples: drivers: counter: alarm: Fix compilation for nrf boards

Sample was not compiling for nordic boards because RTC_0
instance was not enabled by default and RTC_0 device is using
different DT define.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
  • Loading branch information...
nordic-krch authored and nashif committed Jun 11, 2019
1 parent aabe964 commit ea44b056bcaa589b242a54a24f065a4d0eb0bfd7
@@ -0,0 +1,14 @@

# Kconfig - Config for counter alarm sample
#
# Copyright (c) 2019 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: Apache-2.0
#


config COUNTER_RTC0
bool
default y if SOC_FAMILY_NRF

source "Kconfig.zephyr"
@@ -40,6 +40,10 @@ void main(void)

printk("Counter alarm sample\n\n");
counter_dev = device_get_binding(DT_RTC_0_NAME);
if (counter_dev == NULL) {
printk("Device not found\n");
return;
}

counter_start(counter_dev);

@@ -20,4 +20,7 @@

#define DT_WDT_0_NAME DT_NORDIC_NRF_WATCHDOG_WDT_0_LABEL

#define DT_RTC_0_NAME DT_NORDIC_NRF_RTC_RTC_0_LABEL
#define DT_RTC_1_NAME DT_NORDIC_NRF_RTC_RTC_1_LABEL

/* End of SoC Level DTS fixup file */
@@ -29,4 +29,8 @@

#define DT_WDT_0_NAME DT_NORDIC_NRF_WATCHDOG_WDT_0_LABEL

#define DT_RTC_0_NAME DT_NORDIC_NRF_RTC_RTC_0_LABEL
#define DT_RTC_1_NAME DT_NORDIC_NRF_RTC_RTC_1_LABEL
#define DT_RTC_2_NAME DT_NORDIC_NRF_RTC_RTC_2_LABEL

/* End of SoC Level DTS fixup file */
@@ -32,10 +32,13 @@
#define DT_SPI_2_NAME DT_NORDIC_NRF_SPI_SPI_2_LABEL
#define DT_SPI_3_NAME DT_NORDIC_NRF_SPI_SPI_3_LABEL

#define DT_WDT_0_NAME DT_NORDIC_NRF_WATCHDOG_WDT_0_LABEL
#define DT_WDT_0_NAME DT_NORDIC_NRF_WATCHDOG_WDT_0_LABEL

#define DT_TIMER_0_NAME DT_NORDIC_NRF_TIMER_TIMER_0_LABEL
#define DT_TIMER_1_NAME DT_NORDIC_NRF_TIMER_TIMER_1_LABEL
#define DT_TIMER_2_NAME DT_NORDIC_NRF_TIMER_TIMER_2_LABEL
#define DT_TIMER_0_NAME DT_NORDIC_NRF_TIMER_TIMER_0_LABEL
#define DT_TIMER_1_NAME DT_NORDIC_NRF_TIMER_TIMER_1_LABEL
#define DT_TIMER_2_NAME DT_NORDIC_NRF_TIMER_TIMER_2_LABEL

#define DT_RTC_0_NAME DT_NORDIC_NRF_RTC_RTC_0_LABEL
#define DT_RTC_1_NAME DT_NORDIC_NRF_RTC_RTC_1_LABEL

/* End of SoC Level DTS fixup file */

0 comments on commit ea44b05

Please sign in to comment.
You can’t perform that action at this time.