 So if we now go into our E-Warm folder and launch our project EWW, we need to go into the FreeRTOS.C and we need to scroll down to find our pre-sleep processing which is at line 106 and you can see it's the Cubamex software has already placed in two weak subroutines ready for us to place our user code here. So we need to look at the pre-sleep processing so we will remove the weak function and we will now add our line of code which is the howpower underscore enter sleep mode routine and we have got the hint appearing on the screen so it wants us to now say what we want to do with the regulator and it wants to know what our command is for the entry point. So for the regulator it will be main reg later still on and we want to have our sleep entry point as wait for interrupt command. So that's all we need to add to our code. We don't need to add anything to the post-sleep processing so we'll leave that one be. So we can now build our code. I can't spell. There we go missing a T out. So we try that again. So we get zero arrows and zero warnings so we can now project download and download application into our target board. Then we now reset our board and switch on our multimeter. I am now running at 8.2 milliamps in stop mode and about 10.4 milliamps in run mode. So this is what we had originally so originally I was about 15 and 17 so my stop mode was slightly lower than what the screen capture shows here and my modes again are slightly lower than what we've got here so I've got 8.5 in stop and about 10.4 in run mode. So therefore just by reducing the idle state from running to sleep we have now saved about 40% of our current consumption in stop mode and about 33% of our current consumption in run mode. So what else can we do to squeeze more out of our project to reduce our current consumption? So we can now have a look at the peripherals. So what do we have within the peripherals? We have the clock powering all of these various peripherals that we're using in our application. Now a lot of the time we don't need to at the clock each individual section of the system because the clocking is only really for configuring certain parts of the system and then when they need to change states. So we can enable clock gating on certain periphery with inside the application that we do not need to use. So there's various peripherals that we need to keep running so the display for example has to be kept running GPIOs because we're relying on the external interrupts they need to be alive but other parts of the system like the I2C and anything else we don't actually need to keep running. So what we need to do now is enable the clock gating of the peripherals we need and disable all the peripherals that we don't need. So there's a view from the datasheets and it shows you all the various peripherals that are enabled and there's a handful of peripherals that we can now disable which are the bus structures for the GPIO, the I2C and the power supply. So we can now put all of those areas into a sleep state. So we'll now add this to our project and we'll start from where we've just left off. We don't need to go into CubaMex to do this this is just purely a code modification. So we're going to go into our IAR project where we were. We're going to add those five or six lines that we've just seen on the previous screen. I'll put them back up again in a second and then we're going to recompile the code and try running the play and stop modes again and having a look at our current consumption at this point.