diff --git a/multi_button.c b/multi_button.c index d1861e3..51febe6 100644 --- a/multi_button.c +++ b/multi_button.c @@ -5,7 +5,7 @@ #include "multi_button.h" -#define EVENT_CB(ev) if(handle->cb[ev])handle->cb[ev]((Button*)handle) +#define EVENT_CB(ev) if(handle->cb[ev])handle->cb[ev]((void*)handle) //button handle list head. static struct Button* head_handle = NULL; @@ -142,7 +142,7 @@ static void button_handler(struct Button* handle) //continue hold trigger handle->event = (uint8_t)LONG_PRESS_HOLD; EVENT_CB(LONG_PRESS_HOLD); - } else { //releasd + } else { //released handle->event = (uint8_t)PRESS_UP; EVENT_CB(PRESS_UP); handle->state = 0; //reset diff --git a/multi_button.h b/multi_button.h index a5bfc99..2974168 100644 --- a/multi_button.h +++ b/multi_button.h @@ -6,8 +6,8 @@ #ifndef _MULTI_BUTTON_H_ #define _MULTI_BUTTON_H_ -#include "stdint.h" -#include "string.h" +#include +#include //According to your need to modify the constants. #define TICKS_INTERVAL 5 //ms