Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: GPS.cpp
- Revision:
- 75:ce6e12067d0c
- Parent:
- 74:208e3e32d263
- Child:
- 76:f7c3dd568dae
--- a/GPS.cpp Thu May 15 22:20:42 2014 +0000
+++ b/GPS.cpp Fri May 16 14:13:00 2014 +0000
@@ -258,7 +258,7 @@
#endif
}
-bool GPSSerial::init(void)
+bool GPSSerial::init(PinName pn)
{
// send a byte to wakup the device again
putc(0);
@@ -301,12 +301,14 @@
#endif
}
-bool GPSI2C::init(void)
+bool GPSI2C::init(PinName pn)
{
- DigitalOut pin(GPSINT, 0);
- wait_us(1);
- pin = 1;
- RELAX_MS(100);
+ if (pn != NC) {
+ DigitalOut pin(pn, 0);
+ wait_us(1);
+ pin = 1;
+ RELAX_MS(100);
+ }
return !I2C::write(_i2cAdr,®STREAM,sizeof(REGSTREAM));
}