hal_entry.c 957 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright (c) 2006-2025, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2025-08-19 BruceOu first version
  9. */
  10. #include <rtthread.h>
  11. #include "hal_data.h"
  12. #ifdef RT_USING_NANO
  13. #include <drv_gpio.h>
  14. #else
  15. #include <rtdevice.h>
  16. #endif /* RT_USING_NANO */
  17. #define LED1_PIN BSP_IO_PORT_02_PIN_07 /* Onboard LED1 pins */
  18. #define LED2_PIN BSP_IO_PORT_04_PIN_00 /* Onboard LED2 pins */
  19. #define LED3_PIN BSP_IO_PORT_01_PIN_13 /* Onboard LED3 pins */
  20. void hal_entry(void)
  21. {
  22. rt_kprintf("\nHello RT-Thread!\n");
  23. while (1)
  24. {
  25. rt_pin_write(LED1_PIN, PIN_HIGH);
  26. rt_pin_write(LED2_PIN, PIN_HIGH);
  27. rt_pin_write(LED3_PIN, PIN_HIGH);
  28. rt_thread_mdelay(500);
  29. rt_pin_write(LED1_PIN, PIN_LOW);
  30. rt_pin_write(LED2_PIN, PIN_LOW);
  31. rt_pin_write(LED3_PIN, PIN_LOW);
  32. rt_thread_mdelay(500);
  33. }
  34. }