main.c 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. * 2021-03-17 supperthomas first version
  9. */
  10. #include <rtthread.h>
  11. #include <board.h>
  12. /* defined the LED0 pin: PI8 */
  13. #define LED0_PIN GET_PIN(I, 8)
  14. #ifdef RT_USING_WIFI
  15. extern void wlan_autoconnect_init(void);
  16. #endif
  17. int main(void)
  18. {
  19. /* set LED0 pin mode to output */
  20. rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT);
  21. #ifdef RT_USING_WIFI
  22. /* init Wi-Fi auto connect feature */
  23. wlan_autoconnect_init();
  24. /* enable auto reconnect on WLAN device */
  25. rt_wlan_config_autoreconnect(RT_TRUE);
  26. #endif
  27. while (1)
  28. {
  29. rt_pin_write(LED0_PIN, PIN_HIGH);
  30. rt_thread_mdelay(500);
  31. rt_pin_write(LED0_PIN, PIN_LOW);
  32. rt_thread_mdelay(500);
  33. }
  34. }
  35. #include "stm32h7xx.h"
  36. static int vtor_config(void)
  37. {
  38. /* Vector Table Relocation in Internal QSPI_FLASH */
  39. SCB->VTOR = QSPI_BASE;
  40. return 0;
  41. }
  42. INIT_BOARD_EXPORT(vtor_config);