Set OS time tick priority

Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/5376a6f2
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/5376a6f2
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/5376a6f2

Branch: refs/heads/master
Commit: 5376a6f2f9750e3cd46829bc311b409188e96ed1
Parents: 99f3e5f
Author: wes3 <w...@micosa.io>
Authored: Wed Feb 3 13:05:15 2016 -0800
Committer: wes3 <w...@micosa.io>
Committed: Wed Feb 3 13:06:42 2016 -0800

----------------------------------------------------------------------
 hw/bsp/nrf51dk/src/os_bsp.c | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/5376a6f2/hw/bsp/nrf51dk/src/os_bsp.c
----------------------------------------------------------------------
diff --git a/hw/bsp/nrf51dk/src/os_bsp.c b/hw/bsp/nrf51dk/src/os_bsp.c
index 1596d2e..24b8c94 100644
--- a/hw/bsp/nrf51dk/src/os_bsp.c
+++ b/hw/bsp/nrf51dk/src/os_bsp.c
@@ -19,6 +19,8 @@
 #include "mcu/nrf51_bitfields.h"
 #include "mcu/nrf51_hal.h"
 
+#define BSP_LOWEST_PRIO     ((1 << __NVIC_PRIO_BITS) - 1)
+
 static struct flash_area bsp_flash_areas[] = {
     [FLASH_AREA_BOOTLOADER] = {
         .fa_flash_id = 0,       /* internal flash */
@@ -125,6 +127,7 @@ os_bsp_systick_init(uint32_t os_ticks_per_sec)
     NRF_RTC0->TASKS_CLEAR = 1;
 
     /* Set isr in vector table and enable interrupt */
+    NVIC_SetPriority(RTC0_IRQn, BSP_LOWEST_PRIO - 1);
     NVIC_SetVector(RTC0_IRQn, (uint32_t)rtc0_timer_handler);
     NVIC_EnableIRQ(RTC0_IRQn);
 

Reply via email to