document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. /**
  2.  * Startup code of firmware
  3.  */
  4. #include "stm32f10x.h"
  5. #include "core_cm3.h"
  6. #include "main.h"
  7. void SystemInit(void);
  8. void main(void);
  9. /* provided by linker script */
  10. extern unsigned long _estack;
  11. /* user status flag */
  12. /* reset handler */
  13. void Reset_Handler(void) {
  14.     SystemInit();
  15.     main();
  16. }
  17. /* EXTI line0 interrupt */
  18. void EXTI_L0_Handler(void) {
  19.     if (EXTI->PR & (1 << 0)) {
  20.         NVIC_SystemReset();
  21.         EXTI->PR |= (1 << 0);
  22.     }
  23.    
  24. }
  25. /* table of Cortex vectors */
  26. void *vector_table[] __attribute__ ((section(".vectors"))) = {
  27.     &_estack,
  28.     Reset_Handler,      /*!#0 cortex-m3 reset interrupt begin code of this */
  29.     0,                  /*!#1 cortex-m3 non maskable interrupt */
  30.     0,                  /*!#2 cortex-m3 hardware fault interrupt */
  31.     0,                  /*!#3 cortex-m3 memory management interrupt */
  32.     0,                  /*!#4 cortex-m3 bus fault interrupt */
  33.     0,                  /*!#5 cortex-m3 usage fault interrupt */
  34.     0,                  /*!#6 reserved */
  35.     0,                  /*!#7 reserved */
  36.     0,                  /*!#8 reserved */
  37.     0,                  /*!#9 reserved */
  38.     0,                  /*!#10 cortex-m3 system service interrupt */
  39.     0,                  /*!#11 cortex-m3 debug monitor interrupt */
  40.     0,                  /*!#12 reserved */
  41.     0,                  /*!#13 cortex-m3 penable request for system service interrupt */
  42.     0,                  /*!#14 cortex-m3 system tick timer interrupt */
  43.     0,                  /*!%0 window watchdog interrupt */
  44.     0,                  /*!%1 PVD through EXTI line detection interrupt */
  45.     0,                  /*!%2 tamper adn timestamp through EXTI interrupt */
  46.     0,                  /*!%3 RTC wakeup through EXTI interrupt */
  47.     0,                  /*!%4 flash global interrupt */
  48.     0,                  /*!%5 RCC global interrupt */
  49.     EXTI_L0_Handler,    /*!%6 EXTI line0 interrupt */
  50.     0,                  /*!%7 EXTI line1 interrupt */
  51.     0,                  /*!%8 EXTI line2 interrupt */
  52.     0,                  /*!%9 EXTI line3 interrupt */
  53.     0,                  /*!%10 EXTI line4 interrupt */
  54.     0,                  /*!%11 DMA1 channel 1 global interrupt */
  55.     0,                  /*!%12 DMA1 channel 2 global interrupt */
  56.     0,                  /*!%13 DMA1 channel 3 global interrupt */
  57.     0,                  /*!%14 DMA1 channel 4 global interrupt */
  58.     0,                  /*!%15 DMA1 channel 5 global interrupt */
  59.     0,                  /*!%16 DMA1 channel 6 global interrupt */
  60.     0,                  /*!%17 DMA1 channel 7 global interrupt */
  61.     0,                  /*!%18 ADC1 global interrupt */
  62.     0,                  /*!%19 reserved */
  63.     0,                  /*!%20 reserved */
  64.     0,                  /*!%21 reserved */
  65.     0,                  /*!%22 reserved */
  66.     0,                  /*!%23 EXTI line[9:5] interrupts */
  67.     0,                  /*!%24 TIM1 break and TIM15 global interrupt */
  68.     0,                  /*!%25 TIM1 update and TIM16 global interrupt */
  69.     0,                  /*!%26 TIM1 trigger and commutation and TIM17 global interrupt */
  70.     0,                  /*!%27 TIM1 capture compare interrupt */
  71.     0,                  /*!%28 TIM2 global interrupt */
  72.     0,                  /*!%29 TIM3 global interrupt */
  73.     0,                  /*!%30 TIM4 global interrupt */
  74.     0,                  /*!%31 I2C1 event interrupt */
  75.     0,                  /*!%32 I2C1 error interrupt */
  76.     0,                  /*!%33 I2C2 event interrupt */
  77.     0,                  /*!%34 I2C2 error interrupt */
  78.     0,                  /*!%35 SPI1 global interrupt */
  79.     0,                  /*!%36 SPI2 global interrupt */
  80.     0,                  /*!%37 USART1 global interrupt */
  81.     0,                  /*!%38 USART2 global interrupt */
  82.     0,                  /*!%39 USART3 global interrupt */
  83.     0,                  /*!%40 EXTI line[15:10] interrupts */
  84.     0,                  /*!%41 RTC alarm through EXTI line interrupt */
  85.     0,                  /*!%42 HDMI-CEC interrupt */
  86.     0,                  /*!%43 reserved */
  87.     0,                  /*!%44 reserved */
  88.     0,                  /*!%45 reserved */
  89.     0,                  /*!%46 reserved */
  90.     0,                  /*!%47 reserved */
  91.     0,                  /*!%48 reserved */
  92.     0,                  /*!%49 reserved */
  93.     0,                  /*!%50 reserved */
  94.     0,                  /*!%51 reserved */
  95.     0,                  /*!%52 reserved */
  96.     0,                  /*!%53 reserved */
  97.     0,                  /*!%54 TIM6 and DAC underrun interrupt */
  98.     0,                  /*!%55 TIM7 interrupt */
  99. };
');