From d6a83a0520d6bee7ec0005f53a885db045331287 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Thu, 20 Jun 2024 11:41:38 +0200 Subject: [PATCH] Allow duplicate values in mark channels --- src/emu/ovni/mark.c | 3 +++ test/emu/ovni/libovni-mark.c | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/src/emu/ovni/mark.c b/src/emu/ovni/mark.c index e887ae5..75314a1 100644 --- a/src/emu/ovni/mark.c +++ b/src/emu/ovni/mark.c @@ -311,6 +311,9 @@ create_thread_chan(struct ovni_mark_emu *m, struct bay *bay, struct thread *th) struct chan *ch = &t->channels[i]; chan_init(ch, type->ctype, fmt, th->gindex, type->type); + /* Allow duplicates */ + chan_prop_set(ch, CHAN_ALLOW_DUP, 1); + if (bay_register(bay, ch) != 0) { err("bay_register failed"); return -1; diff --git a/test/emu/ovni/libovni-mark.c b/test/emu/ovni/libovni-mark.c index 21a6694..7f62346 100644 --- a/test/emu/ovni/libovni-mark.c +++ b/test/emu/ovni/libovni-mark.c @@ -63,6 +63,12 @@ main(void) ovni_mark_set(MARK_PROGRESS, i); } + /* Ensure we can emit the same value several times */ + for (int i = 0; i < 10; i++) { + sleep_us(10); + ovni_mark_set(MARK_PROGRESS, 100); + } + instr_end(); return 0;