main.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2021-01-04 iysheng first version
  9. */
  10. #include <board.h>
  11. #include <drivers/adc.h>
  12. #include <rtdbg.h>
  13. #include <stdio.h>
  14. #include <rtthread.h>
  15. #include "board.h"
  16. #define LED1 GET_PIN(C, 0)
  17. int main(void)
  18. {
  19. rt_pin_mode(LED1, PIN_MODE_OUTPUT);
  20. while (1)
  21. {
  22. rt_pin_write(LED1, PIN_HIGH);
  23. rt_thread_mdelay(500);
  24. rt_pin_write(LED1, PIN_LOW);
  25. rt_thread_mdelay(500);
  26. }
  27. return 0;
  28. }
  29. #ifndef ASSERT_NDEBUG
  30. /**
  31. * @brief Reports the name of the source file and the source line number
  32. * where the assert_errhandler error has occurred.
  33. * @param file: pointer to the source file name
  34. * @param line: assert_errhandler error line source number
  35. * @retval None
  36. */
  37. void assert_errhandler(uint8_t* file, uint32_t line)
  38. {
  39. /* User can add his own implementation to report the file name and line number,
  40. ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
  41. /* Infinite loop */
  42. while (1)
  43. {
  44. }
  45. }
  46. #endif