board.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * File : board.c
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2009 - 2011 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. * 2011-02-24 Bernard first implementation
  13. */
  14. #include <rthw.h>
  15. #include <rtthread.h>
  16. #include "board.h"
  17. #include "mb9bf506r.h"
  18. #include "serial.h"
  19. #include "nand.h"
  20. extern const uint32_t SystemFrequency;
  21. /**
  22. * @addtogroup FM3
  23. */
  24. /*@{*/
  25. /**
  26. * This is the timer interrupt service routine.
  27. *
  28. */
  29. void rt_hw_timer_handler(void)
  30. {
  31. /* enter interrupt */
  32. rt_interrupt_enter();
  33. rt_tick_increase();
  34. /* leave interrupt */
  35. rt_interrupt_leave();
  36. }
  37. /**
  38. * This function will initial FM3 Easy Kit board.
  39. */
  40. void rt_hw_board_init()
  41. {
  42. /* init systick */
  43. SysTick_Config(SystemFrequency/RT_TICK_PER_SECOND);
  44. /* initialize UART device */
  45. rt_hw_serial_init();
  46. /* set console as UART device */
  47. rt_console_set_device("uart2");
  48. /* initialize nand flash device */
  49. rt_hw_nand_init();
  50. }
  51. /*@}*/