helpfor studient

Dependents:   STM32_F103-C8T6basecanblink_led

Fork of mbed-dev by mbed official

Revision:
150:02e0a0aed4ec
Parent:
149:156823d33999
Child:
151:5eaa88a5bcc7
--- a/targets/TARGET_NORDIC/TARGET_NRF5/us_ticker.c	Fri Oct 28 11:17:30 2016 +0100
+++ b/targets/TARGET_NORDIC/TARGET_NRF5/us_ticker.c	Tue Nov 08 17:45:16 2016 +0000
@@ -40,6 +40,7 @@
 #include "common_rtc.h"
 #include "app_util.h"
 #include "nrf_drv_common.h"
+#include "nrf_drv_config.h"
 #include "lp_ticker_api.h"
 
 
@@ -76,12 +77,19 @@
     }
 }
 
+#if (defined (__ICCARM__)) && defined(TARGET_MCU_NRF51822)//IAR
+__stackless __task 
+#endif
+void RTC1_IRQHandler(void);
+
 void common_rtc_init(void)
 {
     if (m_common_rtc_enabled) {
         return;
     }
 
+    NVIC_SetVector(RTC1_IRQn, (uint32_t)RTC1_IRQHandler);
+    
     // RTC is driven by the low frequency (32.768 kHz) clock, a proper request
     // must be made to have it running.
     // Currently this clock is started in 'SystemInit' (see "system_nrf51.c"
@@ -125,7 +133,12 @@
         US_TICKER_INT_MASK);
 
     nrf_drv_common_irq_enable(nrf_drv_get_IRQn(COMMON_RTC_INSTANCE),
-        APP_IRQ_PRIORITY_LOW);
+#ifdef NRF51
+        APP_IRQ_PRIORITY_LOW
+#elif defined(NRF52)
+        APP_IRQ_PRIORITY_LOWEST
+#endif
+        );
 
     nrf_rtc_task_trigger(COMMON_RTC_INSTANCE, NRF_RTC_TASK_START);