From d6e76482adced83f835a1d1f075826ccf24034ca Mon Sep 17 00:00:00 2001 From: Megan Wachs Date: Tue, 24 Jan 2017 17:02:02 -0800 Subject: use relaxed memory model for bitbang demo to avoid unncessary fences in the output --- software/demo_gpio/demo_gpio.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'software') diff --git a/software/demo_gpio/demo_gpio.c b/software/demo_gpio/demo_gpio.c index 040d864..00bc8cd 100644 --- a/software/demo_gpio/demo_gpio.c +++ b/software/demo_gpio/demo_gpio.c @@ -232,10 +232,9 @@ int main(int argc, char **argv) * Atomics give a quick way to control a single bit. *************************************************************************/ uint32_t mask = (1 << PIN_19_OFFSET); - uint32_t other_mask = (1 << PIN_19_OFFSET); while (1){ - atomic_fetch_xor(&GPIO_REG(GPIO_OUTPUT_VAL), mask); + atomic_fetch_xor_explicit(&GPIO_REG(GPIO_OUTPUT_VAL), mask, memory_order_relaxed); } return 0; -- cgit v1.2.3