In the code, system is doing so many tasks such as controlling house lights, running the motor, monitoring temperature, controlling AC ans doing number of task's
Do you think I really need interrupt to switch off all devices or I should write code in side the main function ?
C:
main(void)
{
/* initialize all devices */
initialize ();
/*routine to Control House Light */
Control_House_Light();
/*routine to run Motor */
Motor_Run ();
/* routine to monitor temperature */
monitor_temperature();
/* and so many task */
}
/*System is required to be switched off all devices when fire alarm is activated */
/* call the interrupt service routine if fire detected */
interrupt
{
/* When fire sensor is activate switched off all devices */
switch_off_Devices ();
Turn_On _Buzzer ();
}