Skip to content

Commit 2045108

Browse files
committed
Move SysTimer to platform, for non-RTOS use
1 parent 28b7705 commit 2045108

File tree

5 files changed

+10
-12
lines changed

5 files changed

+10
-12
lines changed

TESTS/mbedmicro-rtos-mbed/systimer/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
extern "C" {
2727
#include "rtx_lib.h"
2828
}
29-
#include "rtos/TARGET_CORTEX/SysTimer.h"
29+
#include "platform/SysTimer.h"
3030

3131
#define TEST_TICKS 42UL
3232
#define DELAY_DELTA_US 2500ULL
@@ -44,7 +44,7 @@ using namespace utest::v1;
4444
const us_timestamp_t DELAY_US = 1000000ULL * TEST_TICKS / OS_TICK_FREQ;
4545

4646
// Override the handler() -- the SysTick interrupt must not be set as pending by the test code.
47-
class SysTimerTest: public rtos::internal::SysTimer {
47+
class SysTimerTest: public mbed::internal::SysTimer {
4848
private:
4949
Semaphore _sem;
5050
virtual void handler()

rtos/TARGET_CORTEX/SysTimer.cpp renamed to platform/SysTimer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2020
* SOFTWARE.
2121
*/
22-
#include "rtos/TARGET_CORTEX/SysTimer.h"
22+
#include "platform/SysTimer.h"
2323

2424
#if MBED_TICKLESS
2525

@@ -55,7 +55,7 @@ extern "C" IRQn_Type mbed_get_m0_tick_irqn(void);
5555
extern "C" IRQn_ID_t mbed_get_a9_tick_irqn(void);
5656
#endif
5757

58-
namespace rtos {
58+
namespace mbed {
5959
namespace internal {
6060

6161
SysTimer::SysTimer() :

rtos/TARGET_CORTEX/SysTimer.h renamed to platform/SysTimer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include "platform/NonCopyable.h"
2828
#include "drivers/TimerEvent.h"
2929

30-
namespace rtos {
30+
namespace mbed {
3131
namespace internal {
3232

3333
/**

rtos/LICENSE.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ Files licensed under MIT:
77
- TARGET_CORTEX/mbed_rtos_storage.h
88
- TARGET_CORTEX/mbed_rtx_conf.h
99
- TARGET_CORTEX/mbed_rtx_idle.cpp
10-
- TARGET_CORTEX/SysTimer.h
11-
- TARGET_CORTEX/SysTimer.cpp
1210
- ConditionVariable.cpp
1311
- ConditionVariable.h
1412
- EventFlags.cpp

rtos/TARGET_CORTEX/mbed_rtx_idle.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,20 @@ extern "C" {
4646
#error Low power ticker required when MBED_CONF_TARGET_TICKLESS_FROM_US_TICKER is false
4747
#endif
4848

49-
#include "rtos/TARGET_CORTEX/SysTimer.h"
49+
#include "platform/SysTimer.h"
5050

51-
static rtos::internal::SysTimer *os_timer;
52-
static uint64_t os_timer_data[sizeof(rtos::internal::SysTimer) / 8];
51+
static mbed::internal::SysTimer *os_timer;
52+
static uint64_t os_timer_data[sizeof(mbed::internal::SysTimer) / 8];
5353

5454
// Enable System Timer.
5555
void OS_Tick_Enable(void)
5656
{
5757
// Do not use SingletonPtr since this relies on the RTOS
5858
if (NULL == os_timer) {
5959
#if MBED_CONF_TARGET_TICKLESS_FROM_US_TICKER
60-
os_timer = new (os_timer_data) rtos::internal::SysTimer(get_us_ticker_data());
60+
os_timer = new (os_timer_data) mbed::internal::SysTimer(get_us_ticker_data());
6161
#else
62-
os_timer = new (os_timer_data) rtos::internal::SysTimer(get_lp_ticker_data());
62+
os_timer = new (os_timer_data) mbed::internal::SysTimer(get_lp_ticker_data());
6363
#endif
6464
os_timer->setup_irq();
6565
}

0 commit comments

Comments
 (0)