SRM32F411RE,Port output variable not working
Moderator: Benj
-
- Posts: 107
- Joined: Tue Oct 04, 2011 8:55 am
- Has thanked: 3 times
- Been thanked: 6 times
- Contact:
SRM32F411RE,Port output variable not working
Loading to the chip does not work when using BOOL D as the output of port B10.why?
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
- Contact:
Re: SRM32F411RE,Port output variable not working
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
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.
In my test version I used D = !D which does work.
(as I've been a C programmer for the last 40 years
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.
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
- Contact:
Re: SRM32F411RE,Port output variable not working
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
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