Comments (1)
/**
- @brief Initializes the button struct handle.
- @param handle: the button handle strcut.
- @param pin_level: read the HAL GPIO of the connet button level.
- @param active_level: pressed GPIO level.
- @RetVal None
/
void button_init(struct Button handle, uint8_t(*pin_level)(), uint8_t active_level)
{
memset(handle, 0, sizeof(struct Button));
handle->event = (uint8_t)NONE_PRESS;
handle->hal_button_Level = pin_level;
handle->active_level = active_level;
handle->btn_level = !active_level;
// handle->btn_level = handle->hal_button_Level(); // Keil C51在这里不能调用这个函数,否则会出现令人费解的错误,如果读取到的点平为
// 高电平,这个函数里handle->btn_level会被设置为1,但是实际上handle所指向的
// 结构体中的btn_level还是0。!!!
}
from multibutton.
Related Issues (20)
- 组合键如何实现呢? HOT 2
- MultiButton
- 关于按键去抖动 HOT 1
- bug 注意!按键多次抖动导致 长按不调用解决方法 HOT 3
- MultiButton状态图 HOT 6
- 在Button结构体加入个uint8_t参数方便统一按键读取入口,并且解决多按键读取问题
- 132行 连击加长按会在短时延时到时时会触发一次按下按键吧? HOT 1
- button_init函数输入的函数指针少了形参会编译警告 HOT 2
- 请问是否有计划加入中断触发按钮检测的功能吗? HOT 2
- 有矩阵按键的功能吗? HOT 1
- button_ticks这个函数在MultiTimer的定时器回调函数中调用导致程序跑飞 HOT 1
- 双击后无法触发长按 HOT 4
- unit8_t 和 uint8_t?
- 为什么回调连击的时候不修改事件
- 多个按键共用同一套长短按阈值参数 HOT 3
- 为什么multil press要去切换到single press状态,直接切换到SHORT PRESS UP状态不是更好嘛, 而且切换到single press状态还有冗余部分
- 可以把按键的事件传入回调里 HOT 4
- 是否考虑加入矩阵键盘? HOT 1
- 按键删除 HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from multibutton.