menuconfig 中搜索 CONFIG_EXAMPLES_BUTTONS
选择(1)EXAMPLES_BUTTONS [=y] 开启,
然后选中(2)设置 button 节点的名字为(/dev/buttons)
EXAMPLES_BUTTONS_DEVPATH [=/dev/buttons]
然后设置(5) Number of Buttons in the Board 为5
| +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |
| | --- Buttons driver example | |
| | (buttons) Program name | |
| | (100) Button task priority | |
| | (4096) Button stack size | |
| | (/dev/buttons) Button device path | |
| | [*] Show Buttons Names | |
| | Notification mechanism (Notify using signals) ---> | |
| | (5) Number of Buttons in the Board | |
| | (BUTTON0) Button 0 Name | |
| | (BUTTON1) Button 1 Name | |
| | (BUTTON2) Button 2 Name | |
| | (BUTTON3) Button 3 Name | |
| | (BUTTON4) Button 4 Name | |
| | (BUTTON5) Button 5 Name | |
| | (BUTTON6) Button 6 Name | |
| | (BUTTON7) Button 7 Name | |
| |
重编译后运行buttons ,按下 按键会看到打印按键值