main.c 604 B

1234567891011121314151617181920212223242526272829303132
  1. /*!
  2. \file main.c
  3. \brief the example of EXTI which generates an interrupt request and toggle the LED
  4. */
  5. /*
  6. Copyright (C) 2017 GigaDevice
  7. 2017-06-06, V1.0.0, firmware for GD32F3x0
  8. */
  9. #include "gd32f3x0.h"
  10. #include "gd32f3x0_eval.h"
  11. /*!
  12. \brief main function
  13. \param[in] none
  14. \param[out] none
  15. \retval none
  16. */
  17. int main(void)
  18. {
  19. /* initialize the LEDs and turn on LED1 */
  20. gd_eval_led_init(LED1);
  21. gd_eval_led_init(LED2);
  22. gd_eval_led_on(LED1);
  23. /* configure the tamper key */
  24. gd_eval_key_init(KEY_TAMPER, KEY_MODE_EXTI);
  25. while (1);
  26. }