Sfoglia il codice sorgente

- Add GLONASS/GALILEO (if the module supports it)
- Enable SBAS

k4be 2 anni fa
parent
commit
4c0f851f11
3 ha cambiato i file con 8 aggiunte e 4 eliminazioni
  1. 5 1
      soft/main.c
  2. 2 2
      soft/nmea.c
  3. 1 1
      soft/uart0.c

+ 5 - 1
soft/main.c

@@ -267,6 +267,10 @@ void close_files(unsigned char flush_logs) {
 	disk_ioctl(0, CTRL_POWER, 0);
 }
 
+void uart0_put_wrap(int c) {
+	uart0_put((char)c);
+}
+
 __flash const char __open_msg[] = "Open %s\r\n";
 
 /*-----------------------------------------------------------------------*/
@@ -340,7 +344,7 @@ int main (void)
 		FLAGS |= F_POW;
 		_delay_ms(300);	/* Delay */
 		uart0_init();	/* Enable UART */
-//		xfprintf(uart0_put, PSTR("$PSRF106,21*0F\r\n"));	/* Send initialization command (depends on the receiver) */
+		xfprintf(uart0_put_wrap, PSTR("$PMTK353,1,1,1,0,0*2A\r\n$PMTK313,1*2E\r\n"));	/* Send initialization command (depends on the receiver) */
 
 		for (;;) { /* main loop */
 			wdt_reset();

+ 2 - 2
soft/nmea.c

@@ -180,10 +180,10 @@ static void gp_gga_parse(const char *str) {
 }
 
 time_t gps_parse(const char *str) {	/* Get all required data from NMEA sentences */
-	if (!gp_comp(str, PSTR("$GPRMC"))) {
+	if (!gp_comp(str, PSTR("$GPRMC")) || !gp_comp(str, PSTR("$GNRMC"))) {
 		return gp_rmc_parse(str);
 	}
-	if (!gp_comp(str, PSTR("$GPGGA"))) {
+	if (!gp_comp(str, PSTR("$GPGGA")) || !gp_comp(str, PSTR("$GNGGA"))) {
 		gp_gga_parse(str);
 		return 0;
 	}

+ 1 - 1
soft/uart0.c

@@ -25,7 +25,7 @@
 #define	USE_TXINT		0
 #define	SZ_FIFO			512
 #define RECEIVE			1
-#define TRANSMIT		0
+#define TRANSMIT		1
 
 #include "uart.c"