cpu.c 943 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * File : cpu.c
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006 - 2010, RT-Thread Development 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-07-09 Bernard first version
  13. * 2010-09-11 Bernard add CPU reset implementation
  14. */
  15. #include <rtthread.h>
  16. #include <soc3210.h>
  17. /**
  18. * @addtogroup Loogonson SoC3210
  19. */
  20. /*@{*/
  21. /**
  22. * this function will reset CPU
  23. *
  24. */
  25. void rt_hw_cpu_reset()
  26. {
  27. /* open the watch-dog */
  28. WD_TIMER = 0x01; /* watch dog will be timeout after 1 tick */
  29. WD_CTRL |= 0x01;
  30. rt_kprintf("reboot system...\n");
  31. while (1);
  32. }
  33. /**
  34. * this function will shutdown CPU
  35. *
  36. */
  37. void rt_hw_cpu_shutdown()
  38. {
  39. rt_kprintf("shutdown...\n");
  40. while (1);
  41. }
  42. /*@}*/