BAIYI/HARDWARE/EVENT/Single_event_receiver.h

39 lines
875 B
C
Raw Normal View History

#ifndef __Arnold_Single_Event_H__
#define __Arnold_Single_Event_H__
#include <stdio.h>
#include <stdbool.h>
#include <stdint.h>
#define SingleEvent_FOREACH(func)\
func(EVENT_AA) \
func(EVENT_BB) \
func(EVENT_CC) \
func(EVENT_AC) \
func(EVENT_DC) \
#define GetSingleEvent_Enum(x) x##_EM,
#define GetSingleEventEnum(x) x##_EM
typedef enum {
EVENT_NONE,
SingleEvent_FOREACH(GetSingleEvent_Enum)
} SingleEvent_t;
#define MAX_EVENTS 5 //<2F><><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD> MAX_SingleEVENTS-1
#define GetSingleEventFunction(xx) void xx##FUNtion(void);
#define GetSingleEventFunction_NAME(xx) xx##FUNtion()
#define GetSwitchSingleCase(x) case GetSingleEventEnum(x):GetSingleEventFunction_NAME(x);break;
void eventDosomething(void);//<2F>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void add_event(SingleEvent_t event);//<2F><><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>
#define GetEventName(x) GetSingleEventEnum(x)/* <20><>ȡ<EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD> */
#endif