【发布时间】:2020-05-24 16:10:13
【问题描述】:
我在 qemu-stm32 https://github.com/beckus/qemu_stm32 上从 https://github.com/beckus/stm32_p103_demos 运行 button 演示
我可以在led_blink 演示中看到 LED 在控制台中以文本“Led ON”的形式闪烁,但如何模拟按钮按下?
【问题讨论】:
我在 qemu-stm32 https://github.com/beckus/qemu_stm32 上从 https://github.com/beckus/stm32_p103_demos 运行 button 演示
我可以在led_blink 演示中看到 LED 在控制台中以文本“Led ON”的形式闪烁,但如何模拟按钮按下?
【问题讨论】:
尝试使用button_int demo。
来自https://github.com/beckus/stm32_p103_demos/blob/master/README:
button_int -
Example of external interrupts. Toggles the LED every time the
button is pressed. Note that in QEMU, the button press is simulated
by pressing the b key. You will need to do this from the QEMU monitor,
by typing the command "sendkey b".
根据自述文件,button 演示并不总是有效:
button -
Example of using the button in non-interrupt mode. Continuously polls
the button and toggles the LED when the button is pressed. Note that this
example does not seem to work well in QEMU. When using "sendkey b"
(see the button_int demo below), the LED does not toggle. Perhaps
this is a timing issue?
【讨论】: