void InterlockToggle () { uint8_t tmp = TM_BKPSRAM_Read8(0xF00); if (tmp==0xEB) { TM_BKPSRAM_Write8(0xF00,0x00); TM_BKPSRAM_Write8(1000,0xFA); printf("Interlock is now DISABLED\n\r"); } else { TM_BKPSRAM_Write8(0xF00,0xEB); TM_BKPSRAM_Write8(1000,0x02); printf("Interlock in now ENABLED\n\r"); } }
/* This function is used to periodically update LaserLock variables */ void LaserLock_Timer_Task(void* UserParameters) { uint32_t current_time=TM_DELAY_Time(); for (int i=0;i<10;i++) if (current_time > Remote_Data_Array[i].rcv_system_time + LASER_LOCK_TIMEOUT) { Remote_Data_Array[i].laser=0; Laser_Control(i,LD_OFF); TM_BKPSRAM_Write8(i,0); } }
void gsm(void) { char msg[20]; char number[13]; number[12]=0; config(GC_LOAD,&number,GC_PHONE); sprintf(msg,"Off%d",TM_BKPSRAM_Read8(0)); GSM_Init(); for (int i=0;i<10;i++) { GSM_checkNetwork_Simple(15000); if (GSM_isRegistered()) break; } printf("Successfully registered into GMS network\n"); if(GSM_isRegistered()) GSM_sendSMS(number,msg); dev_control(dev_gsm,dev_off); TM_BKPSRAM_Write8(1000,2); }