Import of CSR's demo for SirfV. Has minor cleanup.
Dependencies: CsrLocation mbed GPSProvider
Fork of CsrLocationDemo by
Diff: CsrLocationDemo.cpp
- Revision:
- 17:ebf95368b2d8
- Parent:
- 16:24128dedf8db
- Child:
- 18:c75558f5959f
--- a/CsrLocationDemo.cpp Thu Oct 30 14:44:13 2014 +0000 +++ b/CsrLocationDemo.cpp Fri Oct 31 13:36:57 2014 +0000 @@ -59,6 +59,12 @@ DBG_SERIAL_TYPE sSerialDebug(USBTX, USBRX); +void +locationHandler(const GPSProvider::LocationUpdateParams_t *params) +{ + CSR_APP_LOG_INFO("received location update\r\n"); +} + int main(void) { sLedLocOn = 0; @@ -74,6 +80,7 @@ GPSProvider gps; gps.setPowerMode(GPSProvider::POWER_FULL); gps.reset(); + gps.onLocationUpdate(locationHandler); CSR_APP_LOG_INFO("Success to new csrLocation.\r\n"); _AppShowCmd(); @@ -85,6 +92,7 @@ _AppShowCmd(); break; case APP_CMD_IDLE: + gps.process(); break; case APP_CMD_START: sAppCmd = APP_CMD_IDLE;