--- trunk/Embedded/main.c 2007/12/06 14:19:51 178 +++ trunk/Embedded/main.c 2007/12/09 20:50:42 204 @@ -6,7 +6,6 @@ #include "lcd.h" #include "Delay.h" -// Delay.h is included inside lcd.c #define BUFFER 128 #define PWRFAIL RB1 @@ -152,7 +151,7 @@ RCSTA = 0x90; // 0x90 enables SPEN and CREN in the RCSTA register } -void sms_init(void) +void modem_init(void) { int i; char buf[2]; @@ -219,19 +218,20 @@ void on_initial_recieve(void) { - char imei[16]; - char* ptr; - char i; - char buf[2]; +// 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; +// ptr = strstr(global_serial_recieve_buffer,"cgsn"); +// ptr +=4; +// strncpy(imei, ptr,15); +// imei[15] = 0; reset_recieve_buffer(); } @@ -305,7 +305,7 @@ TMR1L = 0xFF; global_time_counter++; global_emergency_counter++; - RA1 = !RA1; +// RA1 = !RA1; } ////////// ORDENARY FUNKTIONS ////////// void update_lcd(void) @@ -405,9 +405,9 @@ if (strstr(global_message_buffer1,"CMTI") != 0) // here we handles a incomming SMS { ptr = strstr(global_message_buffer1,","); // finds the point just before the nr. of the SMS. - strcat(tmp,ptr+1); // puts that number in tmp - global_sms_recieve_number[0] = 0; // wanna be sure that we write the new number from global_sms_recieve_number[0] - strcat(global_sms_recieve_number, tmp); // puts the sms number into the global variable. + strcat(tmp,ptr+1); // puts that number in tmp + global_sms_recieve_number[0] = 0; // wanna be sure that we write the new number from global_sms_recieve_number[0] + strcat(global_sms_recieve_number, tmp); // puts the sms number into the global variable. sms_recieved(); } reset_recieve_buffer(); @@ -455,7 +455,7 @@ global_time_interval = atoi(buf); global_time_interval *= 60; - eeprom_writer(); // writes the new cell nr. and time interval to the eeprom. + eeprom_writer(); // writes the new cell nr. and time interval to the eeprom. send_sms("conf ok"); } @@ -476,7 +476,7 @@ // Running init for various components. pic18_io_init(); - RA5 = 1; // Indicates that the board is running inits. + RA5 = 1; // Indicates that the board is running inits. rs232_init(); ad_init(); @@ -485,7 +485,7 @@ lcd_home(); interrupt_init(); timer_init(); - sms_init(); + modem_init(); eeprom_reader(); /////////////// // Main loop //