main.c 876 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. * 2018-12-18 zylx first version
  9. */
  10. #include <rtthread.h>
  11. #ifndef RT_USING_NANO
  12. #include <rtdevice.h>
  13. #endif
  14. #include <board.h>
  15. #include <drv_ext_io.h>
  16. int main(void)
  17. {
  18. #ifndef RT_USING_NANO
  19. HC574_SetPin(LED1,0);
  20. HC574_SetPin(LED2,0);
  21. HC574_SetPin(LED3,0);
  22. HC574_SetPin(LED4,0);
  23. while (1)
  24. {
  25. HC574_SetPin(LED1,1);
  26. rt_thread_mdelay(500);
  27. HC574_SetPin(LED1,0);
  28. rt_thread_mdelay(500);
  29. }
  30. #else
  31. #define LED_PB_8 GET_PIN(B, 8)
  32. rt_pin_mode(LED_PB_8, PIN_MODE_OUTPUT);
  33. while (1)
  34. {
  35. rt_pin_write(LED_PB_8, PIN_HIGH);
  36. rt_thread_mdelay(500);
  37. rt_pin_write(LED_PB_8, PIN_LOW);
  38. rt_thread_mdelay(500);
  39. }
  40. #endif
  41. }