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.
Dependents: CsrLocationDemo CsrLocationDemo
Fork of CsrLocation by
Revision 20:88db82cf3f0f, committed 2014-11-27
- Comitter:
- zhjcpi
- Date:
- Thu Nov 27 10:28:35 2014 +0000
- Parent:
- 18:5d72465991f5
- Commit message:
- Support Freescale FDRM platform.
; Location uart cannot use D8/D2, it is changed to D1/D0.
; Trigger on/off before open UART. Otherwise, FDRM will halt when doing the second start(start,then stop, then start again).
Changed in this revision
| CsrLocation.cpp | Show annotated file Show diff for this revision Revisions of this file |
| createCSRGPS.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/CsrLocation.cpp Tue Nov 18 09:03:17 2014 +0000
+++ b/CsrLocation.cpp Thu Nov 27 10:28:35 2014 +0000
@@ -128,6 +128,9 @@
/* Csr Location SDK version */
CSR_LOG_INFO("==== CSR LOC SDK version: %s Date: %s ====\r\n", CSR_LOC_SDK_VER, __DATE__ " " __TIME__);
+ /* trigger on_off */
+ _CsrLocHwOnoff();
+
/* open UART */
if (proto == PROTO_NMEA) {
CSR_LOG_INFO("Checking NMEA protocol...\r\n");
@@ -140,9 +143,6 @@
}
_CsrLocUartInit();
- /* trigger on_off */
- _CsrLocHwOnoff();
-
locState = CSR_LOC_STATE_RUN;
bPwrModeRsp = false;
bVerRsp = false;
@@ -299,6 +299,19 @@
}
while (in != out) {
+ if (bTimeoutFlag) {
+ pTimeoutChk->detach();
+ bTimeoutFlag = false;
+ if ((protoState == PROTO_STATE_DET_OSP) || (protoState == PROTO_STATE_DET_OSP_FROM_NMEA)) {
+ _CsrLocDetProtoOspTimeout();
+ } else if ((protoState == PROTO_STATE_DET_NMEA) || (protoState == PROTO_STATE_DET_NMEA_FROM_OSP)) {
+ _CsrLocDetProtoNmeaTimeout();
+ } else {
+ CSR_LOG_INFO("timeout in unknown protocol state %d.\r\n", protoState);
+ }
+ return;
+ }
+
data = serialBuf[out++];
out &= (MAX_SERIAL_BUF_LEN - 1);
switch (protoState) {
--- a/createCSRGPS.cpp Tue Nov 18 09:03:17 2014 +0000 +++ b/createCSRGPS.cpp Thu Nov 27 10:28:35 2014 +0000 @@ -18,8 +18,13 @@ #include "CsrLocation.h" #include "GPSProviderImplBase.h" +#ifdef TARGET_K64F +#define PINMAP_UART_LOC_TX D1 +#define PINMAP_UART_LOC_RX D0 +#else #define PINMAP_UART_LOC_TX D8 #define PINMAP_UART_LOC_RX D2 +#endif #define PINMAP_GPIO_LOC_ONOFF D9 #define PINMAP_GPIO_LOC_RESET D4 #define PINMAP_GPIO_LOC_WAKEUP D3

GPS mbed Shield