mirror of
https://github.com/markqvist/OpenModem.git
synced 2024-12-24 23:19:36 -05:00
GPS init sequence fix
This commit is contained in:
parent
b075bdd5a1
commit
6c9e0f1fb4
@ -8,7 +8,7 @@
|
||||
#include <stdio.h>
|
||||
#include "device.h"
|
||||
#include "util/time.h"
|
||||
#include "hardware/serial.h"
|
||||
#include "hardware/Serial.h"
|
||||
|
||||
void bluetooth_init(void);
|
||||
bool bluetooth_enabled(void);
|
||||
|
@ -39,6 +39,7 @@ void gps_init(Serial *ser) {
|
||||
gps_speed_kmh = 0;
|
||||
gps_bearing = 0;
|
||||
|
||||
gps_fix = false;
|
||||
gps_time_set = false;
|
||||
|
||||
if (gps_detect()) {
|
||||
@ -46,6 +47,8 @@ void gps_init(Serial *ser) {
|
||||
GPS_DDR |= _BV(GPS_EN_PIN);
|
||||
|
||||
if (config_gps_mode == CONFIG_GPS_AUTODETECT || config_gps_mode == CONFIG_GPS_REQUIRED) {
|
||||
gps_powerup();
|
||||
|
||||
serial_setbaudrate_9600(1);
|
||||
delay_ms(100);
|
||||
|
||||
@ -59,7 +62,6 @@ void gps_init(Serial *ser) {
|
||||
gps_send_command(PMTK_SET_NMEA_OUTPUT_RMCGGA);
|
||||
|
||||
gps_power = true;
|
||||
gps_powerup();
|
||||
} else {
|
||||
gps_power = false;
|
||||
gps_powerdown();
|
||||
@ -71,6 +73,7 @@ void gps_init(Serial *ser) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void gps_update_rtc(void) {
|
||||
struct tm now;
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include <stdio.h>
|
||||
#include "device.h"
|
||||
#include "util/time.h"
|
||||
#include "hardware/serial.h"
|
||||
#include "hardware/Serial.h"
|
||||
|
||||
#define NMEA_MAX_LENGTH 128
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user