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.
Macro behind switch component
Moderator: Benj
-
- Posts: 7
- Joined: Thu Oct 07, 2010 11:35 am
- Location: Austria
- Contact:
-
- Posts: 594
- Joined: Thu Sep 17, 2009 7:52 am
- Location: Belgium
- Has thanked: 63 times
- Been thanked: 102 times
- 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
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.
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
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 7
- Joined: Thu Oct 07, 2010 11:35 am
- Location: Austria
- Contact:
Re: Macro behind switch component
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.
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
- 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
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
Jonny
-
- Posts: 7
- Joined: Thu Oct 07, 2010 11:35 am
- Location: Austria
- Contact:
Re: Macro behind switch component
Hi Jonny
Many thanks for this information.
Yes you are right, this was the problem.
great and fast responce!!!
Thanks to all!!
best regards
Christian
Many thanks for this information.
Yes you are right, this was the problem.
great and fast responce!!!
Thanks to all!!

best regards
Christian
- 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
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
To update the components simply copy the C file into your "Flowcode/v5/Components" directory before starting Flowcode.
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

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
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel