diff --git a/src/gps.c b/src/gps.c index 21ca73a..79bf00d 100644 --- a/src/gps.c +++ b/src/gps.c @@ -334,9 +334,9 @@ void gps_parse(char* line) { if (strstr(line, "GGA") == line+3) { - char* pch = strtok(line, ","); + char* pch = strsep(&line, ","); - pch = strtok(NULL, ","); // Time + pch = strsep(&line, ","); // Time // GPSDO screen is updated once every second, when receiving the PPS signal // BUT, the GGA frame is received a fraction of second AFTER the PPS pulse @@ -394,18 +394,18 @@ void gps_parse(char* line) // Terminaute time string gps_time[8] = '\0'; - pch = strtok(NULL, ","); // Latitude + pch = strsep(&line, ","); // Latitude gps_latitude_double = gps_parse_coordinate(pch,gps_latitude,sizeof(gps_latitude)); - pch = strtok(NULL, ","); // N/S + pch = strsep(&line, ","); // N/S if(strlen(pch)=6) { // Ignore empty dates @@ -650,4 +650,4 @@ void gps_read() HAL_UART_Transmit_IT(&huart3, comm_send_buf, send_size); } -} \ No newline at end of file +}