Is it ok to use the "return" function like this, what I mean is will the local variables and stuff be cleaned up automatically?
This function is called in main, but is in a separate .c file linked by a header.
This function is called in main, but is in a separate .c file linked by a header.
Code:
#include "project.h"
#include "Loop_Functions.h"
#include "Alarm_Macros.h"
void Loop_01(void)
{
uint8 Loop;
uint8 Flag;
CyDelay(5000);
Loop = Loop_1_Read();
Flag = Flag_out_1_Read();
if(Loop == Open && Flag == Down) {Bell_Control_1_Write(1); Bell_Control_2_Write(1);}
else return; // Here is what I mean
Alarm_Write(0);
CyDelay(120000);
Bell_Control_1_Write(0); Bell_Control_2_Write(0);
CyDelay(5000);
Loop = Loop_1_Read();
Flag = Flag_out_1_Read();
if(Loop == Open && Flag == Down) Bell_Control_2_Write(1);
else return; // And here
Flag_in_1_Write(Up);
CyDelay(300000);
Bell_Control_2_Write(0);
Flagged_Write(0);
}