main.c 770 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright (c) 2006-2018, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2019-04-29 tyustli first version
  9. */
  10. #include "MIMXRT1064.h"
  11. #include <rtdevice.h>
  12. #include "drv_gpio.h"
  13. #include "core_cm7.h"
  14. /* defined the LED pin: GPIO1_IO9 */
  15. #define LED0_PIN GET_PIN(1, 9)
  16. int main(void)
  17. {
  18. #ifndef PHY_USING_KSZ8081
  19. /* set LED0 pin mode to output */
  20. rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT);
  21. while (1)
  22. {
  23. rt_pin_write(LED0_PIN, PIN_HIGH);
  24. rt_thread_mdelay(500);
  25. rt_pin_write(LED0_PIN, PIN_LOW);
  26. rt_thread_mdelay(500);
  27. }
  28. #endif
  29. }
  30. void reboot(void)
  31. {
  32. NVIC_SystemReset();
  33. }
  34. MSH_CMD_EXPORT(reboot, reset system)