Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed-os-example-mbed5-blinky by
DuerOS-Light-SDK-v1.1.0/demo/events.h
- Committer:
- TMBOY
- Date:
- 2017-07-18
- Revision:
- 47:9e361da97763
File content as of revision 47:9e361da97763:
// Copyright (2016) Baidu Inc. All rights reserved.
#ifndef BAIDU_IOT_TINYDU_DEMO_EVENTS_H
#define BAIDU_IOT_TINYDU_DEMO_EVENTS_H
#include <mbed.h>
namespace duer {
enum Events {
EVT_KEY_REC_PRESS,
EVT_KEY_REC_RELEASE,
EVT_KEY_PAUSE,
EVT_TOTAL
};
#ifdef MBED_HEAP_STATS_ENABLED
extern void memory_statistics(const char* tag);
#define MEMORY_STATISTICS(...) memory_statistics(__VA_ARGS__)
#else
#define MEMORY_STATISTICS(...)
#endif
typedef mbed::Callback<void ()> event_handle_func;
void event_set_handler(uint32_t evt_id, event_handle_func handler);
template<typename T, typename M>
void event_set_handler(uint32_t evt_id, T* obj, M method) {
event_set_handler(evt_id, event_handle_func(obj, method));
}
void event_trigger(uint32_t evt_id);
void event_loop();
} // namespace duer
#endif // BAIDU_IOT_TINYDU_DEMO_EVENTS_H
