 Okay, now it's time to make some modifications within our generated project. Our goal would be to put some, let's say, code to process the external interrupt callbacks related to all three buttons. All of the callbacks are predefined as an empty function with a weak attribute within the whole GPIO.c file. Here we can track it from interrupt c file. Here we can see the declaration of such a callback. And the callback is in fact the last function called within the interrupt procedure. So after checking what was the root cause of the interrupt, after clearing all of the flags, the callback is called and this is in fact our role to fill this function and execute the proper operations. Additionally, within the main wide one loop for both cores, we would increase once per second two variables. For Cortex-M4 it would be var underscore cm4 and for Cortex-M0+, it would be var underscore cm0p. The code modifications could look like this. On the left side we can see the ARM Cortex-M0+, code. So the declaration of the variable and then we'll say the increase within the while one loop in main.c file and the same story is on the right side for Cortex-M4 devices. So the variable declaration within the user code begin private variable section in main.c file and then within the main function within while one loop increasing the variable and waiting one second. The implementation of the callbacks. On the left side again ARM Cortex-M0+, code. So at the beginning we will check what was the root cause, which button has been pressed and then we will change the state of the LED which is assigned to the same core and the same story on the right side for Cortex-M4. Please have a look on the left side. We've got the project explorer which contains two cores, two projects, one for Cortex-M0+, C-M0+, and the second one for ARM Cortex-M4, which is marked C-M4. So it is done only by adding the proper suffix at the end of the project name. And what is worth to be done is to select this link with editor field and now if I would open from the core main.c files from both projects and I can switch between them I can see immediately from which project this file is coming from. Okay, so now we are ready to perform some coding. I would start from Cortex-M4 code preparation. Let's just have a look what is inside generated project. We can see the standard initialization of the hull structures, the clock configuration and just a preference, in this case only GPIOs. And before wild one top we can see the boot link of CPU to trigger of the boot because WL55, the dual core device is starting in such a way that after the reset Cortex-M4 is always starting automatically and Cortex-M0 plus must be triggered by Cortex-M4 and this is one of the examples how it can be done. This is generated automatically by kubemix or kubide we can see similar function with low layer libraries as well. Okay, so we will start our coding with defining some global variable which we will use within the live expressions so it will be 16 bit without sign type var underscore cm4 initialized to 0 at the beginning. So this would be our first point and then we will increase this variable with wild one loop and we will use some delay to not make it too fast so we will increase it once per second. So this is the first operation we would like to use within the Cortex-M4 core and the second one will be related to the interrupts so we are using let me just say it we are using external interrupts so let me go to this stin4.twlxx underscore it.c file which contains all of the, let's say interrupt functions, body cell for let's say important interrupts like NMI handler, some folds then SVC, Debug Monitor and PentSV and SysTick of course plus interrupts which we have activated within our operations so in our case it is pin PA1 so our B2 button so it is already pre-configured if we go to this over here it's enough to press F3 button and I am landing within howl.gpi.c file I can see that there is an internal checkup what was the source of this interrupt and then clearing the flag and ask a colleague of the callback callback is defined as a weak function so it can be overwritten within our code this will use it so I would just copy this let's say header and I would put it within CortexM4 the good location is this user code begin4 which is after all of the initializations ok, within this callback what I need to do is to check what was the root cause of the interrupt then make the propagation in our case once the B2 button would be pressed I would like to toggle both LEDs LED1 and LED3 which are assigned to the same code so first I need to check whether really my pin 1 has been pressed so I am checking whether it was this fs I will toggle both LEDs so I will use how, GPIO and I know that there is a toggle function so I press only T and then CTRL SPACE it is feeling proposing some function and then I can use let's say the libel name so LED1 and then CTRL SPACE first is the port the same for the pin CTRL SPACE and pin and the same I would do for LED3 so how, GPIO CTRL SPACE now LED3 CTRL SPACE first is port and instead of this LED3 CTRL and I select pin ok, we have got the complete interrupt procedure for Cortex-M for I can save it and now we will switch to Cortex-M0 so I go to the second main I would start from variable initialization so again 16 bit value without sign VAR untouched score CM 0P and we initialize it with 0 and within the same main function I can see that there is only initialization of the functions and then we have got let's say directly this wide one loop within wide one loop we will just increase this variable like in the Cortex-M4 we will do it once per second that's it and we need to interrupts so it will be exactly the same callback structure and in this case we have got two buttons so B1 and B3 B1 is connected to PA0 and B3 is connected to PC6 and both will perform LED2 toggling LED2 is connected to PB9 so again I would check whether my two pins are activated and if yes I would toggle LED add two in this case first is point second one is pin and for the second pin they will be the same so PC6 so GPL underscore pin underscore 6 and I would perform exactly the same operation so how the GPL and LED2 board LED2 control span ok and that's it I need to save all of the save files so I will use this save all and now we can build the code just to make some things more automatic we can connect both projects together within Cortex M0 project I just click left button on mouse and highlight this project making it active I click right button on mouse go to properties and within project references I am selecting this WL basic doorkor CM4 I press apply and close and now if I press the build the hammer to build the projects to be built would be Cortex M4 and the second one Cortex M0 ok so both projects are built I can do it I check it by pressing one by one it is a time to configure a debug session thank you for your attention