Subversion Repositories HomeAutomation

Rev

Rev 1910 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 1910 Rev 2032
Line 27... Line 27...
27
       
27
       
28
        //Get time in UTC
28
        //Get time in UTC
29
        NMEA_data.time_h = 10*a2d(nmea_buffer[6]) + a2d(nmea_buffer[7]);
29
        NMEA_data.time_h = 10*a2d(nmea_buffer[6]) + a2d(nmea_buffer[7]);
30
        NMEA_data.time_m = 10*a2d(nmea_buffer[8]) + a2d(nmea_buffer[9]);
30
        NMEA_data.time_m = 10*a2d(nmea_buffer[8]) + a2d(nmea_buffer[9]);
31
        NMEA_data.time_s = 10*a2d(nmea_buffer[10]) + a2d(nmea_buffer[11]);
31
        NMEA_data.time_s = 10*a2d(nmea_buffer[10]) + a2d(nmea_buffer[11]);
-
 
32
       
-
 
33
        NMEA_data.unixtimestamp = 0
-
 
34
            + NMEA_data.time_s * 1UL
-
 
35
            + NMEA_data.time_m * 60UL
-
 
36
            + NMEA_data.time_h * 3600UL
-
 
37
            + NMEA_data.date_d * 86400UL;
-
 
38
//            + NMEA_data.time_s * 1UL
-
 
39
//            + NMEA_data.time_s * 1UL
32
       
40
 
33
        //Get fixtype
41
        //Get fixtype
34
        NMEA_data.fixvalid=a2d(nmea_buffer[nmea_comindex[5]+1]);
42
        NMEA_data.fixvalid=a2d(nmea_buffer[nmea_comindex[5]+1]);
35
       
43
       
36
        //Get number of satellites used in fix
44
        //Get number of satellites used in fix
Line 214... Line 222...
214
#ifdef TSIP_AT_STARTUP
222
#ifdef TSIP_AT_STARTUP
215
    // Tell GPS to switch to NMEA and 9600 baud
223
    // Tell GPS to switch to NMEA and 9600 baud
216
    //TODO: put in progmem to save space
224
    //TODO: put in progmem to save space
217
    //TODO: do not send this directly at power on, the GPS module is quite slow at startup
225
    //TODO: do not send this directly at power on, the GPS module is quite slow at startup
218
    uint8_t tsip_command[] = {0x10, 0xBC, 0x00, 0x07, 0x07, 0x03, 0x00, 0x00, 0x00, 0x02, 0x04, 0x00, 0x10, 0x03};
226
    uint8_t tsip_command[] = {0x10, 0xBC, 0x00, 0x07, 0x07, 0x03, 0x00, 0x00, 0x00, 0x02, 0x04, 0x00, 0x10, 0x03};
219
    for(i = 0; i<14; i++){
227
    for( uint8_t i = 0; i<14; i++){
220
        uart_putc(tsip_command[i]);
228
        uart_putc(tsip_command[i]);
221
    }
229
    }
222
#endif
230
#endif
223
}
231
}
224
 
232