 Okay, we talk about the interrupts, we talk about how to find the definition of the interrupt, definitely this definition I will show you. Here the NVIC, this name for the set parity you can find here in the STM32F, in my case 401XE and this is the name of the interrupts. Here you can find which interrupts we have on the STM32, but this is not only some interesting part, I think I have one on this part. In the it.c you may be wondering how you can discover this name of this interrupt handler. Okay, QPimx will generate this name for you, but how to discover which name you need to use, because there is many handlers, the SysTape, the MsunFault handlers, and in case that I want to add the interrupts manually, how I can discover this name. This is very easy, this definition of the all interrupt handlers names is hidden in the startup file. It's in the startup file called startup underscore STM32F 401XE.S, in my case, I can open this startup file. What is the startup file? This is file when usually the microcontrollers have the basic configuration which is done after the startup, and here I also define all the interrupt vectors. This file have the end.s, this mean this file is completely written in assembler, but it's not necessary to change this file. Also be careful, this file looks differently in the different IDEs, because unfortunately the assembler routines and the compiler routines which I use in the assembler are not standardized. Then each IDE with their own compiler have the different looks for the IDE. We mainly have, I think, three, one for the IR, second for the KAL, and third for the GCC. We can look on this file. On the beginning, we usually have the allocation of the stack, but here we can see, here is the definition of the vector table, which is the end wake, and we have here all our interrupts. First is the setting of the stack, this is usually our first part in the interrupt table. Second part is the handler for the REST set. REST set is also some kind of the interrupt. Then we can see, nutmaskable interrupt had found our famous sys-tick. Here are watchdogs, it's on, but we can here see the xt, the a0, here to handler. If we compare this name with our IT, you can see the name is identical. Then if you're searching for the new interrupt, you can go into the startup file, copy this interrupt handler and put it, for example, here, define it as a void. In case that you enable this interrupt in your code with the end wake and also configure the pin, the interrupt, it will work. I think we can try it on the end, but what I want to talk about this also, it was here, it's also the definition of the REST set handler. This means that after the microcontour starts, he always starting here from the REST set. Then first what the microcontour execute, it's that he start to execute the system init function, and then he starts to initize the memories and goes to the main.c. Then the microcontour not start in the main.c, he starting here. Then don't forget on this. The system init function is defined here in the CMSIS. It's called the system underscore stm32f4x6. You can see here is the system init. And it's usually only used for the denitization of the microcontour to be sure that you start with the correct parameters. Then the microcontour jumps into the initialization routine when he copy data from the flash into the RAM if you have the initialized variables in your code, and then he jump into the main. This is common for the all IDEs. Only here this assembler file looks a little bit different. And some things which is usually also here in case that your interrupt is not defined in your code here in the interrupt.c and you accidentally enable this interrupt. Then here on the bottom of the startup file are the weak definition of this interrupts. You know like our callbacks, they are defined as weak. Then if you don't use the callback, they use the undefined function. Then it's the same for the interrupt hanglers. If you don't enable the interrupt and you don't define the handler, he can end here and he jump here into the endlessly and he will be here forever. Then be careful. If you during the debugging discover that you are here on some faults or inside the asset vector which belongs to the real time counter it's preferably that you enable the real time counter interrupt but you not define this interrupt inside your code. Okay, this was about the starting the code. Then you now know what the startup file can do for you and also why is the system in it function here. In case that you don't want to delete this if you don't want to set the micro counter in the default state you are sure that the micro counter is in the default. More than less you can for example delete these lines and not use the system in it and you can also delete this file for the IDE. It's on you. Now we wanted to add the new interrupt. I think we can here use the XT1 then here in the interrupt I use the void. I copy the name. It will be also void. I will use again the HLIB for the interrupt handling. This mean I use the HL GPIO underscore XT underscore I try to advise me the handler and pin will be the GPIO pin underscore 1. Okay. Then when I initialize the pin I enable the interrupt then he will handle for me this interrupt. Then in main I definitely need here handle the callback then if my pin is the GPIO underscore pin is equal to GPIO pin underscore 1 then for example I don't know what to put but I can use here this part to turn the light on like not do this with the button I will do this with the pin. Okay. And now I need also I define the callback what will happen after I detect this interrupt but I need also to initialize the pin then I will put it here inside the GPIO mix so it's not so correct but I think it will be faster. I will use the pin I don't know which one I will try the PC1 for example to make for me faster initialization I can here do the trick I here add the end symbol or the OR symbol and I here put the GPIO underscore pin underscore 1 now I initialize the PC13 and also PC1 and both to create the interrupt on the falling edge then this is okay but the last part I definitely need to enable this interrupt then I add here the hl underscore nvc underscore set parity and I can search for the name I will go to definition it will be the STM32F401XE.h I know that this is the name which I need to use put it here I have the separate 0 the pension parity also 0 here I put the hl underscore nvc underscore enable interrupt with the same name after I do this I will be able to use this interrupt and we can try to test this I can run my code I can slide with my finger over these buttons and if you know where is the PC1 then it will work if I slide on the left side it seems it's on the left header I slide with one slide I turn it on and on the end of the header I turn it off and on then it's working we define the handler on our own but with QPEMIX is usually a situation much faster because he do all this for you automatically you don't need to search for the handlers put all the code inside but I wanted to show you how to search for the interrupt handlers that the name is not random the names are fixed