Skip to content

UBLOX_C027: construct a ticker-based wait, rather than calling wait_ms(), in the … #3990

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 29, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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) {
Expand Down