main.c 1.0 KB

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