--- trunk/Embedded/main.c 2007/12/09 10:17:44 200 +++ trunk/Embedded/main.c 2007/12/09 15:07:32 201 @@ -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]; @@ -405,9 +404,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 +454,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 +475,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 +484,7 @@ lcd_home(); interrupt_init(); timer_init(); - sms_init(); + modem_init(); eeprom_reader(); /////////////// // Main loop //