main.c 1005 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. * 2023-07-15 yby the first version
  9. */
  10. #include "board.h"
  11. #define LED_N0 rt_pin_get("PN.0")
  12. #define LED_N1 rt_pin_get("PN.1")
  13. #define LED_F0 GET_PIN(F, 0)
  14. #define LED_F4 GET_PIN(F, 4)
  15. int main(void)
  16. {
  17. rt_uint32_t count = 1;
  18. rt_pin_mode(LED_N0, PIN_MODE_OUTPUT);
  19. rt_pin_mode(LED_N1, PIN_MODE_OUTPUT);
  20. rt_pin_mode(LED_F0, PIN_MODE_OUTPUT);
  21. rt_pin_mode(LED_F4, PIN_MODE_OUTPUT);
  22. while (count++)
  23. {
  24. rt_pin_write(LED_N0, PIN_HIGH);
  25. rt_pin_write(LED_N1, PIN_HIGH);
  26. rt_pin_write(LED_F0, PIN_HIGH);
  27. rt_pin_write(LED_F4, PIN_HIGH);
  28. rt_thread_mdelay(1000);
  29. rt_pin_write(LED_N0, PIN_LOW);
  30. rt_pin_write(LED_N1, PIN_LOW);
  31. rt_pin_write(LED_F0, PIN_LOW);
  32. rt_pin_write(LED_F4, PIN_LOW);
  33. rt_thread_mdelay(1000);
  34. }
  35. return RT_EOK;
  36. }