aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/platforms/LPC11xx/hal_lld.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/platforms/LPC11xx/hal_lld.c')
-rw-r--r--os/hal/platforms/LPC11xx/hal_lld.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/os/hal/platforms/LPC11xx/hal_lld.c b/os/hal/platforms/LPC11xx/hal_lld.c
index 7d831dfa9..d513a6156 100644
--- a/os/hal/platforms/LPC11xx/hal_lld.c
+++ b/os/hal/platforms/LPC11xx/hal_lld.c
@@ -53,6 +53,16 @@
*/
void hal_lld_init(void) {
+ /* Note: PRIGROUP 2:0 (2:6).*/
+// SCB->AIRCR = AIRCR_VECTKEY | SCB_AIRCR_PRIGROUP_0 | SCB_AIRCR_PRIGROUP_1;
+ NVICSetSystemHandlerPriority(HANDLER_SVCALL, CORTEX_PRIORITY_SVCALL);
+ NVICSetSystemHandlerPriority(HANDLER_SYSTICK, CORTEX_PRIORITY_SYSTICK);
+ NVICSetSystemHandlerPriority(HANDLER_PENDSV, CORTEX_PRIORITY_PENDSV);
+
+ /* Systick initialization.*/
+ SysTick->LOAD = LPC11xx_SYSCLK / (8000000 / CH_FREQUENCY) - 1;
+ SysTick->VAL = 0;
+ SysTick->CTRL = SysTick_CTRL_ENABLE_Msk | SysTick_CTRL_TICKINT_Msk;
}
/**