Merge pull request #3990 from u-blox/c027_boot_fix

UBLOX_C027: construct a ticker-based wait, rather than calling wait_ms(), in the …
pull/3994/head
Sam Grove 2017-03-29 22:23:06 +01:00 committed by GitHub
commit 9875c29e60
1 changed files with 5 additions and 1 deletions

View File

@ -16,6 +16,7 @@
#include "gpio_api.h"
#include "mbed_wait_api.h"
#include "C027_api.h"
#include "us_ticker_api.h"
static gpio_t mdmEn, mdmLvlOe, mdmILvlOe, mdmUsbDet;
static gpio_t gpsEn;
@ -36,7 +37,10 @@ void c027_init(void) {
// led should be off
gpio_init_out_ex(&led, LED, 0);
wait_ms(50); // when USB cable is inserted the interface chip issues
// Can't use wait_ms() as RTOS isn't initialised yet
// so this is the correct way to wait for 50 ms
uint32_t start = us_ticker_read();
while ((us_ticker_read() - start) < 50000);
}
void c027_mdm_powerOn(int usb) {