reset.c 929 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. FINSH_FUNCTION_EXPORT_ALIAS(rt_hw_cpu_reset, reset, restart the system);
  35. #ifdef FINSH_USING_MSH
  36. int cmd_reset(int argc, char** argv)
  37. {
  38. rt_hw_cpu_reset();
  39. return 0;
  40. }
  41. int cmd_shutdown(int argc, char** argv)
  42. {
  43. rt_hw_cpu_shutdown();
  44. return 0;
  45. }
  46. FINSH_FUNCTION_EXPORT_ALIAS(cmd_reset, __cmd_reset, restart the system.);
  47. FINSH_FUNCTION_EXPORT_ALIAS(cmd_shutdown, __cmd_shutdown, shutdown the system.);
  48. #endif
  49. #endif
  50. /*@}*/