RTOS: Add required header file and namespace element instead add all

pull/7864/head
Deepika 2018-09-05 10:00:36 -05:00
parent fdcd51d6a7
commit 3d5ec6626f
4 changed files with 12 additions and 13 deletions

View File

@ -20,11 +20,11 @@
* SOFTWARE.
*/
#include "cmsis_os2.h"
#include "rtos/Kernel.h"
#include "mbed.h"
#include "rtos/rtos_idle.h"
#include "rtos/rtos_handlers.h"
#include "platform/mbed_critical.h"
namespace rtos {

View File

@ -20,12 +20,12 @@
* SOFTWARE.
*/
#include "rtos/RtosTimer.h"
#include "platform/Callback.h"
#include "platform/mbed_error.h"
#include "platform/mbed_assert.h"
#include <string.h>
#include "mbed.h"
#include "platform/mbed_error.h"
namespace rtos {
void RtosTimer::constructor(mbed::Callback<void()> func, os_timer_type type) {
@ -34,7 +34,7 @@ void RtosTimer::constructor(mbed::Callback<void()> func, os_timer_type type) {
osTimerAttr_t attr = { 0 };
attr.cb_mem = &_obj_mem;
attr.cb_size = sizeof(_obj_mem);
_id = osTimerNew((void (*)(void *))Callback<void()>::thunk, type, &_function, &attr);
_id = osTimerNew((void (*)(void *))mbed::Callback<void()>::thunk, type, &_function, &attr);
MBED_ASSERT(_id);
}

View File

@ -23,9 +23,9 @@
#define __STDC_LIMIT_MACROS
#include "rtos/ThisThread.h"
#include "mbed.h"
#include "rtos/Kernel.h"
#include "rtos/rtos_idle.h"
#include "mbed_assert.h"
#include "platform/mbed_assert.h"
namespace rtos {

View File

@ -21,11 +21,10 @@
*/
#include "rtos/Thread.h"
#include "rtos/ThisThread.h"
#include "mbed.h"
#include "rtos/rtos_idle.h"
#include "rtos/rtos_handlers.h"
#include "mbed_assert.h"
#include "platform/mbed_assert.h"
#include "platform/mbed_error.h"
#define ALIGN_UP(pos, align) ((pos) % (align) ? (pos) + ((align) - (pos) % (align)) : (pos))
MBED_STATIC_ASSERT(ALIGN_UP(0, 8) == 0, "ALIGN_UP macro error");
@ -68,7 +67,7 @@ void Thread::constructor(osPriority priority,
constructor(MBED_TZ_DEFAULT_ACCESS, priority, stack_size, stack_mem, name);
}
void Thread::constructor(Callback<void()> task,
void Thread::constructor(mbed::Callback<void()> task,
osPriority priority, uint32_t stack_size, unsigned char *stack_mem, const char *name)
{
constructor(MBED_TZ_DEFAULT_ACCESS, priority, stack_size, stack_mem, name);
@ -87,7 +86,7 @@ void Thread::constructor(Callback<void()> task,
}
}
osStatus Thread::start(Callback<void()> task)
osStatus Thread::start(mbed::Callback<void()> task)
{
_mutex.lock();