[ubx] At startup Reset, set UBX, Reset again to cover both power on and already running cases

main-solar-only
Richard Meadows 2015-12-19 23:40:00 +00:00
rodzic c70c0b1800
commit 9eb81330f8
1 zmienionych plików z 6 dodań i 1 usunięć

Wyświetl plik

@ -309,7 +309,7 @@ void gps_cfg_rst(void)
(uint8_t*)&ubx_cfg_rst.payload, (uint8_t*)&ubx_cfg_rst.payload,
sizeof(ubx_cfg_rst.payload)); sizeof(ubx_cfg_rst.payload));
for (int i = 0; i < 1000*100*2; i++); for (int i = 0; i < 1000*100; i++);
} }
@ -586,6 +586,11 @@ void gps_init(void)
/* We use ubx protocol */ /* We use ubx protocol */
gps_set_io_config(GPS_BAUD_RATE); gps_set_io_config(GPS_BAUD_RATE);
/* Reset the GPS */
gps_cfg_rst();
kick_ext_watchdog();
/* Incoming ubx messages are handled in an irq */ /* Incoming ubx messages are handled in an irq */
usart_register_rx_callback(GPS_SERCOM, gps_rx_callback, GPS_SERCOM_INT_PRIO); usart_register_rx_callback(GPS_SERCOM, gps_rx_callback, GPS_SERCOM_INT_PRIO);