Macro behind switch component

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
Chris_Technik-Welt
Posts: 7
Joined: Thu Oct 07, 2010 11:35 am
Location: Austria
Contact:

Macro behind switch component

Post 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.

Spanish_dude
Posts: 594
Joined: Thu Sep 17, 2009 7:52 am
Location: Belgium
Has thanked: 63 times
Been thanked: 102 times

Re: Macro behind switch component

Post by Spanish_dude »

Could you upload tour Flowcode files ?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Macro behind switch component

Post 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.
Attachments
FC5_PIC_SWITCH.c
(6.99 KiB) Downloaded 309 times

User avatar
Steve
Matrix Staff
Posts: 3433
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Re: Macro behind switch component

Post by Steve »

Also, make sure you have not customised the macro code behind the switch component.

Chris_Technik-Welt
Posts: 7
Joined: Thu Oct 07, 2010 11:35 am
Location: Austria
Contact:

Re: Macro behind switch component

Post 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.
Attachments
switch_test.fcf
(11 KiB) Downloaded 302 times

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 63 times
Been thanked: 290 times
Contact:

Re: Macro behind switch component

Post 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

Chris_Technik-Welt
Posts: 7
Joined: Thu Oct 07, 2010 11:35 am
Location: Austria
Contact:

Re: Macro behind switch component

Post 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

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Macro behind switch component

Post 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.
Attachments
FC5_PIC_SWITCH.c
(7.14 KiB) Downloaded 296 times
FC5_PIC_SWITCHbank.c
(8.66 KiB) Downloaded 333 times

Post Reply