board.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * File : board.c
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006, 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. * 2010-01-25 Bernard first version
  13. */
  14. #include <rtthread.h>
  15. #include <rthw.h>
  16. #include "board.h"
  17. #include "uart.h"
  18. #include "CMSIS/CM0/NUC1xx.h"
  19. #include "CMSIS/CM0/core_cm0.h"
  20. /**
  21. * @addtogroup NUC100
  22. */
  23. /*@{*/
  24. /**
  25. * This is the timer interrupt service routine.
  26. */
  27. void rt_hw_timer_handler()
  28. {
  29. /* enter interrupt */
  30. rt_interrupt_enter();
  31. rt_tick_increase();
  32. /* leave interrupt */
  33. rt_interrupt_leave();
  34. }
  35. /**
  36. * This function will initial sam7s64 board.
  37. */
  38. void rt_hw_board_init()
  39. {
  40. SystemInit();
  41. /* init systick */
  42. SysTick_Config(SystemFrequency/RT_TICK_PER_SECOND - 1);
  43. /* set pend exception priority */
  44. NVIC_SetPriority(PendSV_IRQn, (1<<__NVIC_PRIO_BITS) - 1);
  45. #ifdef RT_USING_UART
  46. /* init hardware UART device */
  47. rt_hw_uart_init();
  48. #endif
  49. #ifdef RT_USING_CONSOLE
  50. /* set console device */
  51. rt_console_set_device("uart1");
  52. #endif
  53. }
  54. /*@}*/