main.c 808 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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: PO1 */
  14. #define LED_PIN GET_PIN(O, 1)
  15. int main(void)
  16. {
  17. rt_uint32_t count = 1;
  18. rt_pin_mode(LED_PIN, PIN_MODE_OUTPUT);
  19. while(count++)
  20. {
  21. rt_thread_mdelay(500);
  22. rt_pin_write(LED_PIN, PIN_HIGH);
  23. rt_thread_mdelay(500);
  24. rt_pin_write(LED_PIN, PIN_LOW);
  25. }
  26. return RT_EOK;
  27. }
  28. #include "stm32h7rsxx.h"
  29. static int vtor_config(void)
  30. {
  31. /* Vector Table Relocation in Internal XSPI2_BASE */
  32. SCB->VTOR = XSPI2_BASE;
  33. return 0;
  34. }
  35. INIT_BOARD_EXPORT(vtor_config);