在 qemu-stm32 中模拟按钮



我在 qemu-stm32 上运行button演示 https://github.com/beckus/stm32_p103_demos https://github.com/beckus/qemu_stm32

我可以在演示中看到 LED 闪烁led_blink控制台中的文本"Led ON",但如何模拟按钮按下?

尝试使用button_int演示。

从 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?

最新更新