--- trunk/Embedded/main.c 2007/12/09 21:47:39 207 +++ trunk/Embedded/main.c 2007/12/10 08:02:13 213 @@ -16,8 +16,8 @@ unsigned char global_Pot_Hi, global_Pot_Lo; unsigned char global_serial_send[BUFFER], global_serial_recieve_buffer[BUFFER]; -bit global_recieve_done = 0; //, global_interval_changed = 0; -unsigned int global_serial_byte_counter = 0, global_sms_counter = 1, global_time_counter = 0; //, global_time_counter_image = 0; +bit global_recieve_done = 0; +unsigned int global_serial_byte_counter = 0, global_sms_counter = 1, global_time_counter = 0; unsigned int global_emergency_counter = 600, global_time_interval = 3600; unsigned char global_temp = 0; @@ -59,9 +59,7 @@ global_recieve_done = 0; global_message_buffer_length1 = 0; - //global_message_buffer1[0] = 0; global_message_buffer_length2 = 0; - //global_message_buffer2[0] = 0; memset(global_message_buffer1, 0, BUFFER); memset(global_message_buffer2, 0, BUFFER); @@ -86,8 +84,8 @@ ADCS1 = 0; ADCS2 = 0; - //Select AN0/RA0 for AD source - // In this (000) setup, it's only RA0/AN0 that does ad convertion. + //Select AN0/RA0 for AD source. + // In this (000) setup, it's only RA0/AN0 that does ad convertion. CHS0=0; CHS1=0; CHS2=0; @@ -126,16 +124,16 @@ void timer_init(void) { - TMR1CS = 1; //use external clock + TMR1CS = 1; //use external clock - T1CKPS1 = 1; //1:8 prescale + T1CKPS1 = 1; //1:8 prescale T1CKPS0 = 1; TMR1H = 0xEF; TMR1L = 0xFF; - T1OSCEN = 1; //enable oscillator circuit - RD16 = 0; //normal 8 bit writes + T1OSCEN = 1; //enable oscillator circuit + RD16 = 0; //normal 8 bit writes TMR1ON = 1; } @@ -218,21 +216,9 @@ void on_initial_recieve(void) { -// can't se what the outcommented lines in here sould do, that make any sence. -// char imei[16]; -// char* ptr; -// char i; -// char buf[2]; - if (strstr(global_serial_recieve_buffer,"+WIND: 11") != 0) { global_modem_init = 1; - -// ptr = strstr(global_serial_recieve_buffer,"cgsn"); -// ptr +=4; -// strncpy(imei, ptr,15); -// imei[15] = 0; - reset_recieve_buffer(); } } @@ -493,7 +479,7 @@ DelayMs(50); reset_recieve_buffer(); - RA5 = 0; // Inits are done, and RA1 will now work as a error notifier. + RA5 = 0; // Inits are done, and RA1 will now work as a error notifier. while(1) { @@ -514,13 +500,6 @@ if( global_emergency_counter > 7200 ) global_emergency_counter = 600; -// the outcommented lines are useless, because eeprom_writer() is called from sms_recieved() when the conf sms has been decoded. - // Checks if there has been recieved a config sms. -// if(global_interval_changed ) -// { -// eeprom_writer(); -// global_interval_changed = 0; -// } // Checking if A/D convertion is done, and save the data in global_Pot_?? if(GODONE==0) {