Skip to content

Commit fdcd51d

Browse files
author
Deepika
committed
EventQueue: Add required header file and namespace element instead add all
1 parent a6651b8 commit fdcd51d

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

events/EventQueue.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@
1414
* limitations under the License.
1515
*/
1616
#include "events/EventQueue.h"
17-
1817
#include "events/mbed_events.h"
19-
#include "mbed.h"
2018

19+
using mbed::Callback;
20+
21+
namespace events {
2122

2223
EventQueue::EventQueue(unsigned event_size, unsigned char *event_pointer)
2324
{
@@ -77,3 +78,4 @@ void EventQueue::chain(EventQueue *target)
7778
equeue_chain(&_equeue, 0);
7879
}
7980
}
81+
}

events/equeue/equeue_mbed.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,16 @@
2121
#if defined(EQUEUE_PLATFORM_MBED)
2222

2323
#include <stdbool.h>
24-
#include "mbed.h"
24+
#include <string.h>
25+
#include "platform/mbed_critical.h"
26+
#include "drivers/Timer.h"
27+
#include "drivers/Ticker.h"
28+
#include "drivers/Timeout.h"
29+
#include "drivers/LowPowerTimeout.h"
30+
#include "drivers/LowPowerTicker.h"
31+
#include "drivers/LowPowerTimer.h"
32+
33+
using namespace mbed;
2534

2635
// Ticker operations
2736
#if MBED_CONF_RTOS_PRESENT
@@ -33,6 +42,7 @@ unsigned equeue_tick() {
3342
#else
3443

3544
#if MBED_CONF_EVENTS_USE_LOWPOWER_TIMER_TICKER
45+
3646
#define ALIAS_TIMER LowPowerTimer
3747
#define ALIAS_TICKER LowPowerTicker
3848
#define ALIAS_TIMEOUT LowPowerTimeout

events/mbed_shared_queues.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515
*/
1616

1717
#include "events/mbed_shared_queues.h"
18-
#include "mbed.h"
18+
19+
#ifdef MBED_CONF_RTOS_PRESENT
20+
#include "rtos/Thread.h"
21+
using rtos::Thread;
22+
#endif
1923

2024
using namespace events;
2125

0 commit comments

Comments
 (0)