Fixed uBlox I2C compile error

master
Sven Steudte 2017-10-31 06:36:03 +01:00
rodzic 311c532d1f
commit d642472fed
2 zmienionych plików z 5 dodań i 3 usunięć

Wyświetl plik

@ -43,7 +43,7 @@ uint8_t gps_receive_byte(void)
#if defined(UBLOX_USE_I2C)
uint16_t len;
I2C_read16(UBLOX_MAX_ADDRESS, 0xFD, &len);
if(len) {
if(len)
I2C_read8(UBLOX_MAX_ADDRESS, 0xFF, &val);
#elif defined(UBLOX_USE_UART)
val = sdGetTimeout(&SD5, TIME_IMMEDIATE);
@ -358,8 +358,10 @@ bool GPS_Init(void) {
palSetLineMode(LINE_GPS_TXD, PAL_MODE_ALTERNATE(11)); // UART TXD
// Init UART
#if defined(UBLOX_USE_UART)
TRACE_INFO("GPS > Init GPS UART");
sdStart(&SD5, &gps_config);
#endif
// Switch MOSFET
TRACE_INFO("GPS > Switch on");

Wyświetl plik

@ -12,8 +12,8 @@
#define UBLOX_MAX_ADDRESS 0x42
// You can either use I2C or UART
#define UBLOX_USE_UART
//#define UBLOX_USE_I2C
//#define UBLOX_USE_UART
#define UBLOX_USE_I2C
#define isGPSLocked(pos) ((pos)->type == 3 && (pos)->num_svs >= 5)