Skip to content

Commit d30ae07

Browse files
author
Cruz Monrreal
authored
Merge pull request #8008 from deepikabhavnani/cleanup_features
Add required header file and namespace element instead add all
2 parents b16e271 + 9db31d2 commit d30ae07

File tree

22 files changed

+52
-29
lines changed

22 files changed

+52
-29
lines changed

TESTS/lorawan/loraradio/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838

3939

4040
using namespace utest::v1;
41+
using namespace mbed;
4142

4243
static LoRaRadio *radio = NULL;
4344
rtos::Semaphore event_sem(0);

TESTS/mbed_platform/FileHandle/TestFile.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,13 @@
1818

1919
#include "platform/FileHandle.h"
2020

21-
2221
#define POS_IS_VALID(pos) (pos >= 0 && pos < _end)
2322
#define NEW_POS_IS_VALID(pos) (pos >= 0 && pos < (int32_t)FILE_SIZE)
2423
#define SEEK_POS_IS_VALID(pos) (pos >= 0 && pos <= _end)
2524
#define INVALID_POS (-1)
2625

2726
template<uint32_t FILE_SIZE>
28-
class TestFile : public FileHandle {
27+
class TestFile : public mbed::FileHandle {
2928
public:
3029
TestFile(): _pos(0), _end(0) {}
3130
~TestFile() {}

components/storage/blockdevice/COMPONENT_SPIF/TESTS/block_device/spif/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "utest.h"
1919
#include "SPIFBlockDevice.h"
2020
#include "mbed_trace.h"
21+
#include "rtos/Thread.h"
2122
#include <stdlib.h>
2223

2324
using namespace utest::v1;

features/device_key/TESTS/device_key/functionality/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#endif
2626

2727
using namespace utest::v1;
28+
using namespace mbed;
2829

2930
#define MSG_VALUE_DUMMY "0"
3031
#define MSG_VALUE_LEN 32

features/frameworks/greentea-client/source/greentea_metrics.cpp

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,10 @@
1515
* limitations under the License.
1616
*/
1717

18-
#include "mbed.h"
19-
#include "rtos.h"
20-
#include "mbed_stats.h"
21-
#include "cmsis_os2.h"
2218
#include "greentea-client/test_env.h"
2319
#include "greentea-client/greentea_metrics.h"
24-
#include "SingletonPtr.h"
25-
#include "CircularBuffer.h"
20+
#include "platform/mbed_stats.h"
21+
#include <stdint.h>
2622

2723
#define THREAD_BUF_COUNT 16
2824

@@ -33,6 +29,21 @@ typedef struct {
3329
} thread_info_t;
3430

3531
#if defined(MBED_STACK_STATS_ENABLED) && MBED_STACK_STATS_ENABLED
32+
33+
#if !defined(MBED_CONF_RTOS_PRESENT) || !(MBED_CONF_RTOS_PRESENT)
34+
#error "RTOS required for Stack stats"
35+
#endif
36+
37+
#include "rtos/Mutex.h"
38+
#include "rtos/Thread.h"
39+
#include "rtos/Kernel.h"
40+
#include "mbed_stats.h"
41+
#include "cmsis_os2.h"
42+
#include "platform/SingletonPtr.h"
43+
#include "platform/CircularBuffer.h"
44+
using namespace mbed;
45+
using namespace rtos;
46+
3647
// Mutex to protect "buf"
3748
static SingletonPtr<Mutex> mutex;
3849
static char buf[128];
@@ -43,7 +54,9 @@ static SingletonPtr<CircularBuffer<thread_info_t, THREAD_BUF_COUNT> > queue;
4354
static void send_CPU_info(void);
4455
#endif
4556

57+
#if defined(MBED_HEAP_STATS_ENABLED ) && MBED_HEAP_STATS_ENABLED
4658
static void send_heap_info(void);
59+
#endif
4760
#if defined(MBED_STACK_STATS_ENABLED) && MBED_STACK_STATS_ENABLED
4861
static void send_stack_info(void);
4962
static void on_thread_terminate(osThreadId_t id);
@@ -64,7 +77,9 @@ void greentea_metrics_setup()
6477

6578
void greentea_metrics_report()
6679
{
80+
#if defined(MBED_HEAP_STATS_ENABLED ) && MBED_HEAP_STATS_ENABLED
6781
send_heap_info();
82+
#endif
6883
#if defined(MBED_STACK_STATS_ENABLED) && MBED_STACK_STATS_ENABLED
6984
send_stack_info();
7085
Kernel::attach_thread_terminate_hook(NULL);
@@ -87,13 +102,15 @@ static void send_CPU_info()
87102
}
88103
#endif
89104

105+
#if defined(MBED_HEAP_STATS_ENABLED ) && MBED_HEAP_STATS_ENABLED
90106
static void send_heap_info()
91107
{
92108
mbed_stats_heap_t heap_stats;
93109
mbed_stats_heap_get(&heap_stats);
94110
greentea_send_kv("max_heap_usage",heap_stats.max_size);
95111
greentea_send_kv("reserved_heap",heap_stats.reserved_size);
96112
}
113+
#endif
97114

98115
#if defined(MBED_STACK_STATS_ENABLED) && MBED_STACK_STATS_ENABLED
99116
MBED_UNUSED static void send_stack_info()

features/frameworks/greentea-client/source/greentea_test_env.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include <ctype.h>
1919
#include <cstdio>
2020
#include <string.h>
21-
#include "mbed.h"
2221
#include "greentea-client/test_env.h"
2322
#include "greentea-client/greentea_serial.h"
2423
#include "greentea-client/greentea_metrics.h"

features/frameworks/utest/mbed-utest-shim.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
* limitations under the License.
1616
*/
1717

18-
#include "mbed.h"
1918
#include "mbed_critical.h"
2019
#include "utest/utest.h"
2120

features/frameworks/utest/source/utest_shim.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ utest_v1_scheduler_t utest_v1_get_scheduler()
5858
#ifdef YOTTA_MBED_HAL_VERSION_STRING
5959
# include "mbed-hal/us_ticker_api.h"
6060
#else
61-
# include "mbed.h"
61+
#include "platform/SingletonPtr.h"
62+
#include "Timeout.h"
63+
using mbed::Timeout;
6264
#endif
6365

6466
// only one callback is active at any given time

features/frameworks/utest/source/utest_stack_trace.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#ifdef UTEST_STACK_TRACE
1818

1919
#include "greentea-client/test_env.h"
20-
#include "mbed.h"
2120
#include "utest/utest.h"
2221
#include "unity/unity.h"
2322
#include "utest/utest_stack_trace.h"

features/frameworks/utest/utest/utest_scheduler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#ifndef UTEST_SCHEDULER_H
2323
#define UTEST_SCHEDULER_H
2424

25-
#include "mbed.h"
25+
#include "hal/ticker_api.h"
2626
#include <stdint.h>
2727
#include <stdbool.h>
2828
#include <stdio.h>

0 commit comments

Comments
 (0)