diff --git a/README.md b/README.md index 451bb34..e640b28 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,8 @@ int read_button_pin() int main() { button_init(&button1, read_button_pin, 0); - button_attach(&button1, SINGLE_CLICK, BTN1_SINGLE_CLICK_Handler); + button_attach(&button1, PRESSED, BTN1_PRESSED_Handler); + button_attach(&button1, CLICK, BTN1_CLICK_Handler); button_attach(&button1, DOUBLE_CLICK, BTN1_DOUBLE_Click_Handler); button_attach(&button1, LONG_RRESS_START, BTN1_LONG_RRESS_START_Handler); button_attach(&button1, LONG_PRESS_HOLD, BTN1_LONG_PRESS_HOLD_Handler); diff --git a/button.c b/button.c index 4b16e31..380f4e5 100644 --- a/button.c +++ b/button.c @@ -5,8 +5,6 @@ #include "button.h" -#define HIGH 1 -#define LOW 0 #define TICKS_INTERVAL 5 //ms //According to your need to modify the constants. diff --git a/button.h b/button.h index 8e0903b..321efcb 100644 --- a/button.h +++ b/button.h @@ -1,3 +1,8 @@ +/* + * Copyright (c) 2016 Zibin Zheng + * All rights reserved + */ + #ifndef _BUTTON_H_ #define _BUTTON_H_