main.c 714 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (C) 2018 Shanghai Eastsoft Microelectronics Co., Ltd.
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2020-01-14 wangyq the first version
  9. */
  10. #include <rtthread.h>
  11. #include <rtdevice.h>
  12. #include "drv_gpio.h"
  13. #ifdef ES_RTT_APP_LED_PIN
  14. #define LED_PIN ES_RTT_APP_LED_PIN
  15. #else
  16. #define LED_PIN GET_PIN( F , 0 )
  17. #endif
  18. int main(void)
  19. {
  20. int count = 1;
  21. /* set pin mode to output */
  22. rt_pin_mode(LED_PIN, PIN_MODE_OUTPUT);
  23. while (count++)
  24. {
  25. rt_pin_write(LED_PIN, PIN_HIGH);
  26. rt_thread_mdelay(500);
  27. rt_pin_write(LED_PIN, PIN_LOW);
  28. rt_thread_mdelay(500);
  29. }
  30. return RT_EOK;
  31. }