main.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. * 2019-10-24 Magicoe first version
  9. *
  10. */
  11. #include <rtdevice.h>
  12. #include "drv_pin.h"
  13. /* defined the LED pin: GPIO1_IO4 */
  14. /* GPIO1_4 is Blue LED */
  15. #define LEDB_PIN GET_PINS(1, 4)
  16. int main(void)
  17. {
  18. #if defined(__CC_ARM)
  19. rt_kprintf("using armcc, version: %d\n", __ARMCC_VERSION);
  20. #elif defined(__clang__)
  21. rt_kprintf("using armclang, version: %d\n", __ARMCC_VERSION);
  22. #elif defined(__ICCARM__)
  23. rt_kprintf("using iccarm, version: %d\n", __VER__);
  24. #elif defined(__GNUC__)
  25. rt_kprintf("using gcc, version: %d.%d\n", __GNUC__, __GNUC_MINOR__);
  26. #endif
  27. rt_pin_mode(LEDB_PIN, PIN_MODE_OUTPUT); /* Set GPIO as Output */
  28. while (1)
  29. {
  30. rt_pin_write(LEDB_PIN, PIN_HIGH); /* Set GPIO output 1 */
  31. rt_thread_mdelay(500); /* Delay 500mS */
  32. rt_pin_write(LEDB_PIN, PIN_LOW); /* Set GPIO output 0 */
  33. rt_thread_mdelay(500); /* Delay 500mS */
  34. }
  35. }
  36. // end file