If someone that has access wants to review and commit it, that'd be swell... This is based off of the most current version of i2c-gps-nav. I've added a few line on each of them for context. Hopefully this is easy to understand.
config.h approx line 656 (Will assume we want disabled by default for most folks)
Code: Select all
/* I2C GPS device made with an independant arduino + GPS device
including some navigation functions
contribution from EOSBandi http://code.google.com/p/i2c-gps-nav/
You have to use at least I2CGpsNav code r33 */
//#define I2C_GPS
// If your I2C GPS board has Sonar support enabled
//#define I2C_GPS_SONAR
def.h approx line 1451
Code: Select all
#if defined(SRF02) || defined(SRF08) || defined(SRF10) || defined(SRC235) || defined(TINY_GPS_SONAR) || defined(I2C_GPS_SONAR)
#define SONAR 1
#else
#define SONAR 0
#endif
def.h approx line 1683
Code: Select all
#define I2C_GPS_WP13 206
#define I2C_GPS_WP14 217
#define I2C_GPS_WP15 228
#define I2C_GPS_SONAR_ALT 239
///////////////////////////////////////////////////////////////////////////////////////////////////
// End register definition
///////////////////////////////////////////////////////////////////////////////////////////////////
GPS approx line 399
Code: Select all
//GPS_ground_course
varptr = (uint8_t *)&GPS_ground_course;
*varptr++ = i2c_readAck();
*varptr = i2c_readNak();
#if defined(I2C_GPS_SONAR)
i2c_rep_start(I2C_GPS_ADDRESS<<1);
i2c_write(I2C_GPS_SONAR_ALT);
i2c_rep_start((I2C_GPS_ADDRESS<<1)|1);
varptr = (uint8_t *)&sonarAlt; // altitude (in cm? maybe)
*varptr++ = i2c_readAck();
*varptr = i2c_readNak();
#endif
if (!f.GPS_FIX_HOME) { //If we don't have home set, do not display anything
GPS_distanceToHome = 0;
GPS_directionToHome = 0;
}