The overall function of the program is to drive an LED strip using voltage across the ADC pins, maybe this is the correct way to go about this or maybe it isn't, I am a total newbie. I'm using Atmel Studio 7, I have attached the main.c below because the file is quite large, it compiles fine on my machine. So far I have managed to turn the ADC on and set the relevant registers to read from a pin. While completing the ADC the program is supposed to wait for the ADC interrupt to trigger and set a flag letting the program know to continue. When the program continues it will read the data from the ADC and run the relevant functions that use that data, repeating as needed.
The problem I'm facing is that during debugging the wait loop never breaks even when the condition for break is met. I've pasted a screenshot showing the exact values at the problem source, it SHOULD be breaking.
I faced an issue previously where an unset pointer was causing the program to step over certain checks and managed to fix it, so it's possible that is causing an issue again?
Any help on this would be great.