Construct a ticker-based wait, rather than calling wait_ms(), in the C027 board startup code since, for mbed 5, wait_ms() is an RTOS function and the RTOS is not initialised at this stage in start-up.

pull/3990/head
Rob Meades 2017-03-22 15:15:06 +00:00
parent b2726470f6
commit 965404c09e
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) {