should be finish but for sure won't work

This commit is contained in:
2023-10-11 12:08:34 +02:00
parent 820aff5af4
commit b3cec6c926
3 changed files with 33 additions and 9 deletions

View File

@ -35,7 +35,10 @@ XFDispatcher::~XFDispatcher() {
}
void XFDispatcher::dispatchEvent(const XFEvent *pEvent) const {
pEvent->getBehavior()->startBehavior();
if(pEvent->getBehavior()->process(pEvent)) { // TODO look weird
//events_.pop();
delete pEvent;
}
}
void XFDispatcher::pushEvent(XFEvent *pEvent) {
@ -51,11 +54,16 @@ void XFDispatcher::unscheduleTimeout(int timeoutId, interface::XFBehavior *pBeha
}
void XFDispatcher::executeOnce() {
//XFEvent* event;
dispatchEvent(events_.front());
events_.pop();
}
int XFDispatcher::execute(const void *param) {
while(true){
executeOnce();
}
}

View File

@ -13,6 +13,12 @@ interface::XFMutex * interface::XFMutex::create()
return new ::XFMutex;
}
void XFMutex::lock() {
}
void XFMutex::unlock() {
}
// TODO: Implement code for XFMutex class
#endif // USE_XF_IDF_STM32_MUTEX_CLASS