kopia lustrzana https://github.com/DL7AD/pecanpico9
Fixed uBlox I2C compile error
rodzic
311c532d1f
commit
d642472fed
|
@ -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");
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue