reset.c 827 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2010-11-13 weety first version
  9. */
  10. #include <rthw.h>
  11. #include <rtthread.h>
  12. #include "dm36x.h"
  13. /**
  14. * @addtogroup DM36X
  15. */
  16. /*@{*/
  17. /**
  18. * reset cpu by dog's time-out
  19. *
  20. */
  21. void machine_reset()
  22. {
  23. reset_system();
  24. }
  25. /**
  26. * shutdown CPU
  27. *
  28. */
  29. void machine_shutdown()
  30. {
  31. }
  32. #ifdef RT_USING_FINSH
  33. #include <finsh.h>
  34. #ifdef FINSH_USING_MSH
  35. int cmd_reset(int argc, char** argv)
  36. {
  37. rt_hw_cpu_reset();
  38. return 0;
  39. }
  40. MSH_CMD_EXPORT_ALIAS(cmd_reset, reset, restart the system);
  41. int cmd_shutdown(int argc, char** argv)
  42. {
  43. rt_hw_cpu_shutdown();
  44. return 0;
  45. }
  46. MSH_CMD_EXPORT_ALIAS(cmd_shutdown, shutdown, shutdown the system);
  47. #endif
  48. #endif
  49. /*@}*/