Skip to content

Commit 3ec5425

Browse files
committed
修改拼写错误
1 parent 492571c commit 3ec5425

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ int main()
118118
button_attach(&btn1, SINGLE_CLICK, BTN1_SINGLE_Click_Handler);
119119
button_attach(&btn1, DOUBLE_CLICK, BTN1_DOUBLE_Click_Handler);
120120
button_attach(&btn1, LONG_PRESS_START, BTN1_LONG_PRESS_START_Handler);
121-
button_attach(&btn2, LONG_PRESS_HOLD, BTN1_LONG_PRESS_HOLD_Handler);
121+
button_attach(&btn1, LONG_PRESS_HOLD, BTN1_LONG_PRESS_HOLD_Handler);
122122
button_start(&btn1);
123123

124124
//make the timer invoking the button_ticks() interval 5ms.
@@ -129,5 +129,3 @@ int main()
129129
{}
130130
}
131131
```
132-
133-

multi_button.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ static struct Button* head_handle = NULL;
1212

1313
/**
1414
* @brief Initializes the button struct handle.
15-
* @param handle: the button handle strcut.
16-
* @param pin_level: read the HAL GPIO of the connet button level.
15+
* @param handle: the button handle struct.
16+
* @param pin_level: read the HAL GPIO of the connected button level.
1717
* @param active_level: pressed GPIO level.
1818
* @param button_id: the button id.
1919
* @retval None
@@ -30,7 +30,7 @@ void button_init(struct Button* handle, uint8_t(*pin_level)(uint8_t), uint8_t ac
3030

3131
/**
3232
* @brief Attach the button event callback function.
33-
* @param handle: the button handle strcut.
33+
* @param handle: the button handle struct.
3434
* @param event: trigger event type.
3535
* @param cb: callback function.
3636
* @retval None
@@ -42,7 +42,7 @@ void button_attach(struct Button* handle, PressEvent event, BtnCallback cb)
4242

4343
/**
4444
* @brief Inquire the button event happen.
45-
* @param handle: the button handle strcut.
45+
* @param handle: the button handle struct.
4646
* @retval button event.
4747
*/
4848
PressEvent get_button_event(struct Button* handle)
@@ -52,7 +52,7 @@ PressEvent get_button_event(struct Button* handle)
5252

5353
/**
5454
* @brief Button driver core function, driver state machine.
55-
* @param handle: the button handle strcut.
55+
* @param handle: the button handle struct.
5656
* @retval None
5757
*/
5858
void button_handler(struct Button* handle)
@@ -69,7 +69,7 @@ void button_handler(struct Button* handle)
6969
handle->button_level = read_gpio_level;
7070
handle->debounce_cnt = 0;
7171
}
72-
} else { //leved not change ,counter reset.
72+
} else { //level not change ,counter reset.
7373
handle->debounce_cnt = 0;
7474
}
7575

@@ -156,7 +156,7 @@ void button_handler(struct Button* handle)
156156

157157
/**
158158
* @brief Start the button work, add the handle into work list.
159-
* @param handle: target handle strcut.
159+
* @param handle: target handle struct.
160160
* @retval 0: succeed. -1: already exist.
161161
*/
162162
int button_start(struct Button* handle)
@@ -173,7 +173,7 @@ int button_start(struct Button* handle)
173173

174174
/**
175175
* @brief Stop the button work, remove the handle off work list.
176-
* @param handle: target handle strcut.
176+
* @param handle: target handle struct.
177177
* @retval None
178178
*/
179179
void button_stop(struct Button* handle)

multi_button.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
//According to your need to modify the constants.
1313
#define TICKS_INTERVAL 5 //ms
14-
#define DEBOUNCE_TICKS 3 //MAX 8
14+
#define DEBOUNCE_TICKS 3 //MAX 7 (0 ~ 7)
1515
#define SHORT_TICKS (300 /TICKS_INTERVAL)
1616
#define LONG_TICKS (1000 /TICKS_INTERVAL)
1717

0 commit comments

Comments
 (0)