Page 1 of 1

SRM32F411RE,Port output variable not working

Posted: Mon Sep 06, 2021 9:09 am
by nnnnff
Loading to the chip does not work when using BOOL D as the output of port B10.why?
Flowcode2.fcfx
(7.97 KiB) Downloaded 129 times

Re: SRM32F411RE,Port output variable not working

Posted: Mon Sep 06, 2021 9:56 am
by LeighM
Ah, well spotted, this is the issue with your Timer interrupt program.
In my test version I used D = !D which does work.
(as I've been a C programmer for the last 40 years :lol:

Bools are simple in C, in that 0 is false, anything else is true.
But this can have complications depending upon how they are stored and processed.

This particular scenario, using NOT on a Bool and starting with D = 1,
has highlighted a potential issue with how Flowcode processes the NOT keyword.
I will discuss this with my colleagues.

Meanwhile please could you use D = !D instead.

Re: SRM32F411RE,Port output variable not working

Posted: Mon Sep 06, 2021 10:34 am
by nnnnff
Everything is normal. Ok. Thank you very much!

Re: SRM32F411RE,Port output variable not working

Posted: Mon Sep 06, 2021 10:56 am
by LeighM
OK, good, thanks for letting us know.
Also, I have been reminded that historically in Flowcode the operators AND, OR and NOT have always been bitwise operators.
So this confirms that you do need to use D=!D in this scenario.
Thanks
Leigh