mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
ports/stm32: Fix microspeech demo.
- Need to poll events to schedule the audio callback after switching from pendsv. - Fixes #1904
This commit is contained in:
parent
0aa18ec11b
commit
0648071141
@ -23,7 +23,7 @@ audio.start_streaming(speech.audio_callback)
|
||||
|
||||
while True:
|
||||
# Run micro-speech without a timeout and filter detections by label index.
|
||||
idx = speech.listen(model, timeout=0, threshold=0.78, filter=[2, 3])
|
||||
idx = speech.listen(model, timeout=0, threshold=0.70, filter=[2, 3])
|
||||
led = led_green if idx == 2 else led_red
|
||||
print(labels[idx])
|
||||
for i in range(0, 4):
|
||||
|
||||
@ -23,7 +23,7 @@ audio.start_streaming(speech.audio_callback)
|
||||
|
||||
while True:
|
||||
# Run micro-speech without a timeout and filter detections by label index.
|
||||
idx = speech.listen(model, timeout=0, threshold=0.78, filter=[2, 3])
|
||||
idx = speech.listen(model, timeout=0, threshold=0.70, filter=[2, 3])
|
||||
led = led_green if idx == 2 else led_red
|
||||
print(labels[idx])
|
||||
for i in range(0, 4):
|
||||
|
||||
@ -170,7 +170,7 @@ STATIC mp_obj_t py_micro_speech_listen(uint n_args, const mp_obj_t *args, mp_map
|
||||
|
||||
uint32_t start = HAL_GetTick();
|
||||
while (timeout == 0 || (HAL_GetTick() - start) < timeout) {
|
||||
__WFI();
|
||||
MICROPY_EVENT_POLL_HOOK
|
||||
|
||||
if (microspeech->new_slices == false) {
|
||||
continue;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user