In the main function, we are simply polling AWD flag. If an AWD (beyond boundary zone) event on
PB1 pin occurs the LED on PD0 starts flashing. If PB1 senses voltage between 200 and 600 ADC counts,
the LED is turned off, indicating guarded zone.
if(ADC1_GetFlagStatus(ADC1_FLAG_AWD))
{
GPIO_WriteReverse(GPIOD, GPIO_PIN_0);
ADC1_ClearFlag(ADC1_FLAG_AWD);
}
else
{
GPIO_WriteHigh(GPIOD, GPIO_PIN_0);
}