GPIO_OUTPUT_SET(14, count > 10)
we normally think we can do this as in C, the expression "count > 10" evaluates to a numeric where 0 = false and not 0 = true which matches the bit_value. However, take great care because GPIO_OUTPUT_SET is not a function but is instead a macro and if one looks at its internals ... you will find that supplying an evaluating expression simply won't work. What you have to do is wrap the expression in parenthesis ... for example:
GPIO_OUTPUT_SET(14, (count > 10))
If you don't, your code will compile cleanly but at runtime, you will get unexpected results.
I raised this as a bug with Espressif and supplied the workaround (adding parenthesis around the parameters inside the macro). I thought I'd chance my arm at a bounty
... they responded that the bit_value has to be 0 or 1 and, at this time, can not be an expression ... fair enough ... but I couldn't find that documented ... so a heads-up chums ... be careful if you supply expressions in GPIO_OUTPUT_SET.Statistics: Posted by kolban — Wed Jul 15, 2015 10:04 pm
]]>