1
0

main.c 751 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (c) 2006-2022, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2020-08-20 Abbcc first version
  9. */
  10. #include <rtthread.h>
  11. #include <rtdevice.h>
  12. #include <board.h>
  13. /* defined the LED2 pin: PE6 */
  14. #define LED2_PIN GET_PIN(E, 6)
  15. int main(void)
  16. {
  17. uint32_t sysclock = 0;
  18. /* set LED2 pin mode to output */
  19. rt_pin_mode(LED2_PIN, PIN_MODE_OUTPUT);
  20. /* Print system clock */
  21. sysclock = RCM_ReadSYSCLKFreq();
  22. rt_kprintf("System Clock: %d\n", sysclock);
  23. while (1)
  24. {
  25. rt_pin_write(LED2_PIN, PIN_HIGH);
  26. rt_thread_mdelay(500);
  27. rt_pin_write(LED2_PIN, PIN_LOW);
  28. rt_thread_mdelay(500);
  29. }
  30. }