Page 1 of 1

Macro behind switch component

Posted: Thu Mar 01, 2012 5:30 pm
by Chris_Technik-Welt
Hello

I have open a V4 Project in V5.
All looks fine.
When I build the hex File I found in the compiler messages box
this Information:

Warning: function never returns: 'FCD_SWITCH0_ReadState'
Warning: function nev
........

er returns: 'FCD_SWITCH1_ReadState'
Warning: function never returns: 'FCD_SWITCH2_ReadState'

The switch dosent work when I write the code to hardware.

Re: Macro behind switch component

Posted: Thu Mar 01, 2012 9:07 pm
by Spanish_dude
Could you upload tour Flowcode files ?

Re: Macro behind switch component

Posted: Fri Mar 02, 2012 10:23 am
by Benj
Hi Chris,

Are you using the latest version of the switch component C file.

Simply pop the file below into your "Flowcode/v5/Components" directory before starting up Flowcode.

Re: Macro behind switch component

Posted: Fri Mar 02, 2012 10:27 am
by Steve
Also, make sure you have not customised the macro code behind the switch component.

Re: Macro behind switch component

Posted: Fri Mar 02, 2012 12:57 pm
by Chris_Technik-Welt
Hi Ben

Thanks for the File.
It is the same i have installed.
My Version is V5.1.0.0 (10.02)

@Steve
I have nothing change on our code.

I have write a short test.
Same Error.

Re: Macro behind switch component

Posted: Fri Mar 02, 2012 2:02 pm
by JonnyW
Hi there. The problem I think is with your debounce, which was not implemented in v4. In the Ext properties of your component there is a debounce time field, set to 100. Set this to 64 or less and your code should work OK, as debounce times above this currently cause problems. We will have a look in the code and address this in a future release.

Jonny

Re: Macro behind switch component

Posted: Fri Mar 02, 2012 4:24 pm
by Chris_Technik-Welt
Hi Jonny

Many thanks for this information.
Yes you are right, this was the problem.

great and fast responce!!!
Thanks to all!!
:wink:

best regards
Christian

Re: Macro behind switch component

Posted: Fri Mar 02, 2012 5:23 pm
by Benj
Hello,

Here are the most recent updates to the switch and switch bank components for Flowcode v5.1.

These updated C files fix any issues with polarity or debounce and should allow debounce values up to 65535ms though this would only be needed to debounce one very bouncy switch :D

To update the components simply copy the C file into your "Flowcode/v5/Components" directory before starting Flowcode.