Import of CSR's demo for SirfV. Has minor cleanup.
Dependencies: CsrLocation mbed GPSProvider
Fork of CsrLocationDemo by
Diff: CsrLocationDemo.cpp
- Revision:
- 11:4e0bba518108
- Parent:
- 10:8dbf356c44ec
- Child:
- 13:e0b3e914c709
diff -r 8dbf356c44ec -r 4e0bba518108 CsrLocationDemo.cpp --- a/CsrLocationDemo.cpp Wed Aug 06 02:23:46 2014 +0000 +++ b/CsrLocationDemo.cpp Mon Aug 11 03:23:30 2014 +0000 @@ -30,6 +30,7 @@ APP_CMD_ONOFF_OFF, // Debug command, pull onoff pin low level APP_CMD_RESET_ON, // Debug command, pull reset pin high level APP_CMD_RESET_OFF, // Debug command, pull reset pin low level + APP_CMD_WAKEUP_STATUS, // Debug command, check wakeup pin status APP_CMD_PINTEST_ON, // Debug command, pull test pin high level APP_CMD_PINTEST_OFF, // Debug command, pull test pin low level APP_CMD_PINTEST_OFF_ON // Debug command, pull test pin low firstly, then pull high level @@ -55,6 +56,7 @@ static DigitalOut sPinReset(PINMAP_GPIO_LOC_RESET); static DigitalOut sLedLocOn(LOC_LED1); static DigitalOut sLedPosReport(LOC_LED2); +static DigitalIn sWakeup(PINMAP_GPIO_LOC_WAKEUP); static InterruptIn sBtn(PINMAP_GPIO_BTN); static DigitalOut sPinTest(PINMAP_GPIO_TEST); @@ -78,6 +80,7 @@ locConfig.pSerialLoc = &sSerialLoc; locConfig.pPinOnoff = &sPinOnoff; locConfig.pPinReset = &sPinReset; + locConfig.pWakeup = &sWakeup; /* new the CsrLocation instance */ pCsrLoc = new CsrLocation(&locConfig); @@ -171,6 +174,10 @@ wait_ms(100); sPinTest = 1; break; + case APP_CMD_WAKEUP_STATUS: + CSR_APP_LOG_INFO("wakeup status : %d.\r\n", sWakeup.read()); + sAppCmd = APP_CMD_IDLE; + break; case APP_CMD_PTF_GETPOS: CSR_APP_LOG_INFO("lpm get pos.\r\n"); sAppCmd = APP_CMD_IDLE; @@ -375,6 +382,10 @@ { sAppCmd = APP_CMD_PINTEST_OFF_ON; } + else if(strcmp(pCmd, "iswakeup") == 0) + { + sAppCmd = APP_CMD_WAKEUP_STATUS; + } else { CSR_APP_LOG_INFO("\r\nUnknown command %s\r\n", pCmd);