mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #13264 from ashok-rao/rtos-refactor
Moving around a few items within \rtospull/13317/head
commit
2b60c871d8
|
@ -108,6 +108,7 @@ set(unittest-includes-base
|
|||
"${PROJECT_SOURCE_DIR}/target_h/platform"
|
||||
"${PROJECT_SOURCE_DIR}/target_h/platform/cxxsupport"
|
||||
"${PROJECT_SOURCE_DIR}/target_h/drivers"
|
||||
"${PROJECT_SOURCE_DIR}/target_h/rtos/include"
|
||||
"${PROJECT_SOURCE_DIR}/stubs"
|
||||
"${PROJECT_SOURCE_DIR}/.."
|
||||
"${PROJECT_SOURCE_DIR}/../features"
|
||||
|
@ -119,10 +120,7 @@ set(unittest-includes-base
|
|||
"${PROJECT_SOURCE_DIR}/../events"
|
||||
"${PROJECT_SOURCE_DIR}/../events/source"
|
||||
"${PROJECT_SOURCE_DIR}/../events/internal"
|
||||
"${PROJECT_SOURCE_DIR}/../rtos"
|
||||
"${PROJECT_SOURCE_DIR}/../rtos/TARGET_CORTEX"
|
||||
"${PROJECT_SOURCE_DIR}/../rtos/TARGET_CORTEX/rtx5/Include"
|
||||
"${PROJECT_SOURCE_DIR}/../cmsis"
|
||||
"${PROJECT_SOURCE_DIR}/../rtos/include"
|
||||
"${PROJECT_SOURCE_DIR}/../features/frameworks"
|
||||
"${PROJECT_SOURCE_DIR}/../features/frameworks/mbed-trace"
|
||||
"${PROJECT_SOURCE_DIR}/../connectivity/libraries/nanostack-libservice"
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
|
||||
#include "CellularUtil.h"
|
||||
#include "ThisThread.h"
|
||||
#include "rtos/ThisThread.h"
|
||||
#include "AT_ControlPlane_netif.h"
|
||||
#include "CellularLog.h"
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "Kernel.h"
|
||||
#include "rtos/Kernel.h"
|
||||
|
||||
namespace rtos {
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "Semaphore.h"
|
||||
#include "rtos/Semaphore.h"
|
||||
#include "Semaphore_stub.h"
|
||||
|
||||
int Semaphore_stub::wait_return_value = 0;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#ifndef THREAD_STUB_H_
|
||||
#define THREAD_STUB_H_
|
||||
|
||||
#include "Thread.h"
|
||||
#include "rtos/Thread.h"
|
||||
|
||||
namespace Thread_stub {
|
||||
extern osStatus osStatus_value;
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
#define __MUTEX_H__
|
||||
|
||||
#include <inttypes.h>
|
||||
#include "mbed_rtos_types.h"
|
||||
#include "mbed_rtos1_types.h"
|
||||
#include "rtos/mbed_rtos_types.h"
|
||||
#include "rtos/internal/mbed_rtos1_types.h"
|
||||
|
||||
namespace rtos {
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
#include <stdint.h>
|
||||
#include "cmsis_os2.h"
|
||||
#include "rtos/Kernel.h"
|
||||
|
||||
namespace rtos {
|
||||
class Semaphore {
|
||||
|
@ -28,8 +29,13 @@ public:
|
|||
void acquire();
|
||||
bool try_acquire();
|
||||
bool try_acquire_for(uint32_t millisec);
|
||||
bool try_acquire_for(Kernel::Clock::duration_u32 rel_time);
|
||||
bool try_acquire_until(uint64_t millisec);
|
||||
bool try_acquire_until(Kernel::Clock::time_point abs_time);
|
||||
osStatus release(void);
|
||||
~Semaphore();
|
||||
private:
|
||||
void constructor(int32_t count, uint16_t max_count);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,9 @@
|
|||
|
||||
#include <stdint.h>
|
||||
#include "cmsis_os.h"
|
||||
#include "platform/Callback.h"
|
||||
|
||||
#define OS_STACK_SIZE 0
|
||||
|
||||
namespace rtos {
|
||||
|
||||
|
@ -43,12 +46,10 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
osStatus start(mbed::Callback<void()> task) {
|
||||
return 0;
|
||||
}
|
||||
osStatus start(mbed::Callback<void()> task);
|
||||
|
||||
osStatus join() {return 0;};
|
||||
osStatus terminate(){return 0;};
|
||||
osStatus terminate();
|
||||
osStatus set_priority(osPriority priority){return 0;};
|
||||
osPriority get_priority() const{return osPriorityNormal;};
|
||||
uint32_t flags_set(uint32_t flags){return 0;};
|
||||
|
@ -97,6 +98,14 @@ public:
|
|||
osThreadId_t get_id() const {
|
||||
return 0;
|
||||
};
|
||||
virtual ~Thread();
|
||||
private:
|
||||
// Required to share definitions without
|
||||
// delegated constructors
|
||||
void constructor(osPriority priority = osPriorityNormal,
|
||||
uint32_t stack_size = OS_STACK_SIZE,
|
||||
unsigned char *stack_mem = nullptr,
|
||||
const char *name = nullptr);
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
#define AT_HANDLER_MUTEX
|
||||
|
||||
#if defined AT_HANDLER_MUTEX && defined MBED_CONF_RTOS_PRESENT
|
||||
#include "ConditionVariable.h"
|
||||
#include "rtos/ConditionVariable.h"
|
||||
#endif
|
||||
|
||||
namespace mbed {
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include "PinNames.h"
|
||||
|
||||
#ifdef MBED_CONF_RTOS_PRESENT
|
||||
#include "Thread.h"
|
||||
#include "rtos/Thread.h"
|
||||
#endif // MBED_CONF_RTOS_PRESENT
|
||||
|
||||
/** @file CellularDevice.h
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#if (DEVICE_SERIAL && DEVICE_INTERRUPTIN) || defined(DOXYGEN_ONLY)
|
||||
#include "drivers/BufferedSerial.h"
|
||||
#endif // #if DEVICE_SERIAL
|
||||
#include "ThisThread.h"
|
||||
#include "rtos/ThisThread.h"
|
||||
|
||||
#define NETWORK_TIMEOUT 30min
|
||||
#define DEVICE_TIMEOUT 5min
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
#include "CellularContext.h"
|
||||
#include "ATHandler.h"
|
||||
#include "Semaphore.h"
|
||||
#include "rtos/Semaphore.h"
|
||||
#include "AT_CellularDevice.h"
|
||||
|
||||
const int MAX_APN_LENGTH = 63 + 1;
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include <time.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "ThisThread.h"
|
||||
#include "rtos/ThisThread.h"
|
||||
#include "AT_CellularSMS.h"
|
||||
#include "CellularUtil.h"
|
||||
#include "CellularLog.h"
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#include "AT_CellularStack.h"
|
||||
#include "CellularUtil.h"
|
||||
#include "CellularLog.h"
|
||||
#include "ThisThread.h"
|
||||
#include "rtos/ThisThread.h"
|
||||
#include "AT_CellularDevice.h"
|
||||
|
||||
using namespace mbed_cellular_util;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
|
||||
#include "CellularUtil.h"
|
||||
#include "ThisThread.h"
|
||||
#include "rtos/ThisThread.h"
|
||||
#include "AT_ControlPlane_netif.h"
|
||||
#include "CellularLog.h"
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include "FileHandle.h"
|
||||
#include "mbed_debug.h"
|
||||
#include "rtos/ThisThread.h"
|
||||
#include "Kernel.h"
|
||||
#include "rtos/Kernel.h"
|
||||
#include "CellularUtil.h"
|
||||
#include "SingletonPtr.h"
|
||||
#include "ScopedLock.h"
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
#include "CellularContext.h"
|
||||
#include "CellularLog.h"
|
||||
#include "ThisThread.h"
|
||||
#include "rtos/ThisThread.h"
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include "mbedtls/debug.h"
|
||||
#include "mbedtls/platform.h"
|
||||
#include "mbed_error.h"
|
||||
#include "Kernel.h"
|
||||
#include "rtos/Kernel.h"
|
||||
|
||||
// This class requires Mbed TLS SSL/TLS client code
|
||||
#if defined(MBEDTLS_SSL_CLI_C)
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include "mbed_shared_queues.h"
|
||||
#include "events/EventQueue.h"
|
||||
#include "OnboardNetworkStack.h"
|
||||
#include "Kernel.h"
|
||||
#include "rtos/Kernel.h"
|
||||
#include "PlatformMutex.h"
|
||||
#include "SingletonPtr.h"
|
||||
|
||||
|
|
|
@ -27,8 +27,8 @@
|
|||
#include <stdint.h>
|
||||
#include "rtos/Kernel.h"
|
||||
#include "rtos/mbed_rtos_types.h"
|
||||
#include "rtos/mbed_rtos1_types.h"
|
||||
#include "rtos/mbed_rtos_storage.h"
|
||||
#include "rtos/internal/mbed_rtos1_types.h"
|
||||
#include "rtos/internal/mbed_rtos_storage.h"
|
||||
|
||||
#include "platform/NonCopyable.h"
|
||||
|
|
@ -29,8 +29,8 @@
|
|||
#include "rtos/Queue.h"
|
||||
#include "rtos/MemoryPool.h"
|
||||
#include "rtos/mbed_rtos_types.h"
|
||||
#include "rtos/mbed_rtos_storage.h"
|
||||
#include "rtos/mbed_rtos1_types.h"
|
||||
#include "rtos/internal/mbed_rtos_storage.h"
|
||||
#include "rtos/internal/mbed_rtos1_types.h"
|
||||
|
||||
#include "platform/mbed_toolchain.h"
|
||||
#include "platform/mbed_assert.h"
|
|
@ -27,11 +27,11 @@
|
|||
#include <string.h>
|
||||
|
||||
#include "rtos/mbed_rtos_types.h"
|
||||
#include "rtos/mbed_rtos1_types.h"
|
||||
#include "rtos/mbed_rtos_storage.h"
|
||||
#include "rtos/internal/mbed_rtos1_types.h"
|
||||
#include "rtos/internal/mbed_rtos_storage.h"
|
||||
#include "platform/NonCopyable.h"
|
||||
#include "platform/mbed_assert.h"
|
||||
#include "Kernel.h"
|
||||
#include "rtos/Kernel.h"
|
||||
|
||||
|
||||
#if MBED_CONF_RTOS_PRESENT || defined(DOXYGEN_ONLY)
|
|
@ -25,8 +25,8 @@
|
|||
|
||||
#include <stdint.h>
|
||||
#include "rtos/mbed_rtos_types.h"
|
||||
#include "rtos/mbed_rtos1_types.h"
|
||||
#include "rtos/mbed_rtos_storage.h"
|
||||
#include "rtos/internal/mbed_rtos1_types.h"
|
||||
#include "rtos/internal/mbed_rtos_storage.h"
|
||||
#include "rtos/Kernel.h"
|
||||
|
||||
#include "platform/NonCopyable.h"
|
|
@ -24,8 +24,8 @@
|
|||
#define QUEUE_H
|
||||
|
||||
#include "rtos/mbed_rtos_types.h"
|
||||
#include "rtos/mbed_rtos1_types.h"
|
||||
#include "rtos/mbed_rtos_storage.h"
|
||||
#include "rtos/internal/mbed_rtos1_types.h"
|
||||
#include "rtos/internal/mbed_rtos_storage.h"
|
||||
#include "rtos/Kernel.h"
|
||||
#include "platform/mbed_error.h"
|
||||
#include "platform/NonCopyable.h"
|
|
@ -26,8 +26,8 @@
|
|||
#include <stdint.h>
|
||||
#include <chrono>
|
||||
#include "rtos/mbed_rtos_types.h"
|
||||
#include "rtos/mbed_rtos1_types.h"
|
||||
#include "rtos/mbed_rtos_storage.h"
|
||||
#include "rtos/internal/mbed_rtos1_types.h"
|
||||
#include "rtos/internal/mbed_rtos_storage.h"
|
||||
#include "rtos/Kernel.h"
|
||||
#include "platform/mbed_toolchain.h"
|
||||
#include "platform/NonCopyable.h"
|
|
@ -25,8 +25,8 @@
|
|||
|
||||
#include <stdint.h>
|
||||
#include "rtos/mbed_rtos_types.h"
|
||||
#include "rtos/mbed_rtos1_types.h"
|
||||
#include "rtos/mbed_rtos_storage.h"
|
||||
#include "rtos/internal/mbed_rtos1_types.h"
|
||||
#include "rtos/internal/mbed_rtos_storage.h"
|
||||
#include "platform/Callback.h"
|
||||
#include "platform/mbed_toolchain.h"
|
||||
#include "platform/NonCopyable.h"
|
|
@ -24,7 +24,7 @@
|
|||
#ifndef RTOS_H
|
||||
#define RTOS_H
|
||||
|
||||
#include "rtos/mbed_rtos_storage.h"
|
||||
#include "rtos/internal/mbed_rtos_storage.h"
|
||||
#include "rtos/Kernel.h"
|
||||
#include "rtos/Thread.h"
|
||||
#include "rtos/ThisThread.h"
|
Loading…
Reference in New Issue