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
events.h
00001 // Copyright (2016) Baidu Inc. All rights reserved. 00002 00003 #ifndef BAIDU_IOT_TINYDU_DEMO_EVENTS_H 00004 #define BAIDU_IOT_TINYDU_DEMO_EVENTS_H 00005 00006 #include <mbed.h> 00007 00008 namespace duer { 00009 00010 enum Events { 00011 EVT_KEY_REC_PRESS, 00012 EVT_KEY_REC_RELEASE, 00013 EVT_KEY_PAUSE, 00014 EVT_TOTAL 00015 }; 00016 00017 #ifdef MBED_HEAP_STATS_ENABLED 00018 extern void memory_statistics(const char* tag); 00019 #define MEMORY_STATISTICS(...) memory_statistics(__VA_ARGS__) 00020 #else 00021 #define MEMORY_STATISTICS(...) 00022 #endif 00023 00024 typedef mbed::Callback<void ()> event_handle_func; 00025 00026 void event_set_handler(uint32_t evt_id, event_handle_func handler); 00027 00028 template<typename T, typename M> 00029 void event_set_handler(uint32_t evt_id, T* obj, M method) { 00030 event_set_handler(evt_id, event_handle_func(obj, method)); 00031 } 00032 00033 void event_trigger(uint32_t evt_id); 00034 00035 void event_loop(); 00036 00037 } // namespace duer 00038 00039 #endif // BAIDU_IOT_TINYDU_DEMO_EVENTS_H
Generated on Tue Jul 12 2022 16:28:53 by
1.7.2
