hw/bs/arduino_101: Remove unused code
Ticks are handled in MCU code.
@@ -224,60 +224,3 @@ hal_bsp_init(void)
assert(rc == 0);
#endif
}
-
-extern void timer_handler(void);
-static void
-rtc0_timer_handler(void)
-{
- if (NRF_RTC0->EVENTS_TICK) {
- NRF_RTC0->EVENTS_TICK = 0;
- timer_handler();
- }
-}
-
-void
-os_bsp_systick_init(uint32_t os_ticks_per_sec, int prio)
-{
- uint32_t ctx;
- uint32_t mask;
- uint32_t pre_scaler;
-
- /* Turn on the LFCLK */
- NRF_CLOCK->XTALFREQ = CLOCK_XTALFREQ_XTALFREQ_16MHz;
- NRF_CLOCK->TASKS_LFCLKSTOP = 1;
- NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
- NRF_CLOCK->LFCLKSRC = CLOCK_LFCLKSRC_SRC_Xtal;
- NRF_CLOCK->TASKS_LFCLKSTART = 1;
-
- /* Wait here till started! */
- mask = CLOCK_LFCLKSTAT_STATE_Msk | CLOCK_LFCLKSTAT_SRC_Xtal;
- while (1) {
- if (NRF_CLOCK->EVENTS_LFCLKSTARTED) {
- if ((NRF_CLOCK->LFCLKSTAT & mask) == mask) {
- break;
- }
- }
- }
-
- /* Is this exact frequency obtainable? */
- pre_scaler = (32768 / os_ticks_per_sec) - 1;
-
- /* disable interrupts */
- __HAL_DISABLE_INTERRUPTS(ctx);
-
- NRF_RTC0->TASKS_STOP = 1;
- NRF_RTC0->EVENTS_TICK = 0;
- NRF_RTC0->PRESCALER = pre_scaler;
- NRF_RTC0->INTENCLR = 0xffffffff;
- NRF_RTC0->TASKS_CLEAR = 1;
-
- /* Set isr in vector table and enable interrupt */
- NVIC_SetPriority(RTC0_IRQn, prio);
- NVIC_SetVector(RTC0_IRQn, (uint32_t)rtc0_timer_handler);
- NVIC_EnableIRQ(RTC0_IRQn);
-
- NRF_RTC0->INTENSET = RTC_INTENSET_TICK_Msk;
- NRF_RTC0->TASKS_START = 1;
-
- __HAL_ENABLE_INTERRUPTS(ctx);
-}
