mirror of https://github.com/ARMmbed/mbed-os.git
NVStore: Calling thread wait doesn't depend on RTOS being defined any more.
parent
2b7766a73b
commit
f43e7b1301
|
@ -23,9 +23,7 @@
|
|||
#include "FlashIAP.h"
|
||||
#include "mbed_critical.h"
|
||||
#include "mbed_assert.h"
|
||||
#ifdef MBED_CONF_RTOS_PRESENT
|
||||
#include "Thread.h"
|
||||
#endif
|
||||
#include <algorithm>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
@ -184,9 +182,7 @@ int NVStore::flash_write_area(uint8_t area, uint32_t offset, uint32_t size, cons
|
|||
if (!ret) {
|
||||
return ret;
|
||||
}
|
||||
#ifdef MBED_CONF_RTOS_PRESENT
|
||||
rtos::Thread::wait(1);
|
||||
#endif
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
@ -201,9 +197,7 @@ int NVStore::flash_erase_area(uint8_t area)
|
|||
if (!ret) {
|
||||
return ret;
|
||||
}
|
||||
#ifdef MBED_CONF_RTOS_PRESENT
|
||||
rtos::Thread::wait(1);
|
||||
#endif
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
@ -729,10 +723,8 @@ int NVStore::init()
|
|||
// wait until init is finished.
|
||||
init_attempts_val = core_util_atomic_incr_u32(&_init_attempts, 1);
|
||||
if (init_attempts_val != 1) {
|
||||
#ifdef MBED_CONF_RTOS_PRESENT
|
||||
while (!_init_done)
|
||||
rtos::Thread::wait(1);
|
||||
#endif
|
||||
return NVSTORE_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue