main.c 691 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (c) 2020-2021, Bluetrum Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2020/12/10 greedyhao The first version
  9. */
  10. /**
  11. * Notice!
  12. * All functions or data that are called during an interrupt need to be in RAM.
  13. * You can do it the way exception_isr() does.
  14. */
  15. #include <rtthread.h>
  16. #include "board.h"
  17. int main(void)
  18. {
  19. uint8_t pin = rt_pin_get("PE.1");
  20. rt_pin_mode(pin, PIN_MODE_OUTPUT);
  21. rt_kprintf("Hello, world\n");
  22. while (1)
  23. {
  24. rt_pin_write(pin, PIN_LOW);
  25. rt_thread_mdelay(500);
  26. rt_pin_write(pin, PIN_HIGH);
  27. rt_thread_mdelay(500);
  28. }
  29. }