main.c 723 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (C) 2022-2024, Xiaohua Semiconductor Co., Ltd.
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2022-04-28 CDT first version
  9. * 2024-06-28 yuanzihao adaptation for SkyStar HC32F4A0PITB version
  10. */
  11. #include <rtthread.h>
  12. #include <rtdevice.h>
  13. #include <board.h>
  14. /* defined the LED_GREEN pin: PB2 */
  15. #define LED_GREEN_PIN GET_PIN(B, 2)
  16. int main(void)
  17. {
  18. /* set LED_GREEN_PIN pin mode to output */
  19. rt_pin_mode(LED_GREEN_PIN, PIN_MODE_OUTPUT);
  20. while (1)
  21. {
  22. rt_pin_write(LED_GREEN_PIN, PIN_HIGH);
  23. rt_thread_mdelay(500);
  24. rt_pin_write(LED_GREEN_PIN, PIN_LOW);
  25. rt_thread_mdelay(500);
  26. }
  27. }