board.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * File : board.c
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2015 RT-Thread Develop Team
  5. *
  6. * The license and distribution terms for this file may be
  7. * found in the file LICENSE in this distribution or at
  8. * http://www.rt-thread.org/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date Author Notes
  12. * 2015-11-11 Xue Liu Initial for nRF52
  13. */
  14. #include <rthw.h>
  15. #include <rtthread.h>
  16. #include <nrf52.h>
  17. #include <nrf52_bitfields.h>
  18. #include "board.h"
  19. #include "uart.h"
  20. /**
  21. * @addtogroup NRF52832
  22. */
  23. /** @brief: Function for handling the Systick interrupts.
  24. */
  25. void SysTick_Handler(void)
  26. {
  27. /* enter interrupt */
  28. rt_interrupt_enter();
  29. rt_tick_increase(); //This function will notify kernel there is one tick passed
  30. /* leave interrupt */
  31. rt_interrupt_leave();
  32. }
  33. /**
  34. * This function will initial NRF52832 board.
  35. */
  36. void rt_hw_board_init()
  37. {
  38. /* Configure the SysTick */
  39. SysTick_Config(SystemCoreClock / RT_TICK_PER_SECOND);
  40. /* Initial usart deriver, and set console device */
  41. rt_hw_uart_init();
  42. #ifdef RT_USING_CONSOLE
  43. rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
  44. #endif
  45. }
  46. /*@}*/