STM32 external interrupt handling HAL library

The external interrupts are controlled by LED switching key depression detecting an external interrupt.

Each IO ports can be used as an external interrupt port, you will want to interrupt the external IO ports are set in CUBEMX in.

 

 Interrupt can automatically identify, without manually to change. After other basic set up, complete the external interrupt initialization. This time to enter an interrupt function, the impression that everyone should be the external interrupt function,

 

 But this function is described in the HAL library file,

 

 

That it will perform an external interrupt callback function.

 

 Also found in the library file definition --weak the callback function, weak in fact, means that the definition of an initialization function, you can not change, you change, you will be executed as a function of the change.

So we need to reconstruct a callback function in the main file, as it is to use an interrupt function just fine.

 

 External interrupts complete wording.

 

He said before the serial interrupt callback function call, a principle should also be a reason, explain this. .

Guess you like

Origin www.cnblogs.com/zjx123/p/11866018.html