Page 1 of 1

Error after adding switches to Arduino project

Posted: Wed Dec 03, 2014 4:41 pm
by MJU
When I add a switch array in a Flowcode Arduino project, I get following errors:
Launching compiler...

C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller>"C:\PROGRA~1\Flowcode\v6\COMPIL~1\avr\BATCHF~1\..\bin\avr-gcc.exe" -mmcu=atmega328p -Os -funsigned-char -o "C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.elf" "C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c" -lm
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05263_switch_base1__ReadState':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:317: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:317: error: (Each undeclared identifier is reported only once
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:317: error: for each function it appears in.)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:317: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05263_switch_base1__WaitUntilHigh':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:355: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:355: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05263_switch_base1__WaitUntilLow':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:393: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:393: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05262_switch_base1__ReadState':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:451: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:451: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05262_switch_base1__WaitUntilHigh':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:489: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:489: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05262_switch_base1__WaitUntilLow':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:527: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:527: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05267_switch_base1__ReadState':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:580: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:580: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05267_switch_base1__WaitUntilHigh':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:618: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:618: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05267_switch_base1__WaitUntilLow':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:656: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:656: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05266_switch_base1__ReadState':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:709: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:709: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05266_switch_base1__WaitUntilHigh':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:747: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:747: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05266_switch_base1__WaitUntilLow':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:785: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:785: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05265_switch_base1__ReadState':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:838: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:838: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05265_switch_base1__WaitUntilHigh':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:876: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:876: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05265_switch_base1__WaitUntilLow':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:914: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:914: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05264_switch_base1__ReadState':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:967: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:967: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05264_switch_base1__WaitUntilHigh':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:1005: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:1005: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_05264_switch_base1__WaitUntilLow':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:1043: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:1043: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_08251_switch_array1__ReadState':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:1095: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:1095: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_08251_switch_array1__WaitUntilHigh':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:1213: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:1213: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c: In function 'FCD_08251_switch_array1__WaitUntilLow':
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:1384: error: 'FCP_PIN_A' undeclared (first use in this function)
C:\-MAP~1\FLOWCO~1\FLOWCO~3\Arduino\Teller\Test Arduino teller 2.c:1384: error: 'FCP_TRIS_A' undeclared (first use in this function)

Error returned from [avr-gcc.exe]
.
Completed compilation, return = 1
Without the switch array it works fine.
Any idea?

Re: Error after adding switches to Arduino project

Posted: Wed Dec 03, 2014 6:28 pm
by Benj
Hello,

Are you using Flowcode version 6.1? I think this bug should be fixed in this version.

Re: Error after adding switches to Arduino project

Posted: Wed Dec 03, 2014 8:38 pm
by MJU
Yes, I'm the proud owner of the latest version: 6.1.0.0 (08/10/2014)

Re: Error after adding switches to Arduino project

Posted: Fri Dec 05, 2014 3:29 pm
by Benj
Hello,

I wonder was the program created in an earlier version? If not then we might have missed the fix on a specific component.

The problem is that the array components use a single hidden component like a switch or LED and then clone this as many times as the user requires. The hidden component has the default port connection A0 which may not be present on some devices and causes the compile error.

If you open the component debugger window, click the show full property tree then you should be able to use the drop down menu at the top of the properties window to find the hidden component and give it a meaningful connection. Don't worry it won't actually be used anywhere in the compiled code it just keeps the compiler happy.

I will go through all the array components now and ensure that the latest fix has gone in. The fix is to assign the hidden component the same connection as the switch or led at index 0 of the array component which should ensure it is valid for the selected device.

Re: Error after adding switches to Arduino project

Posted: Fri Dec 05, 2014 3:44 pm
by Benj
Found the problem, The LEDs had been fixed but not the switches.

These should solve the issue for you.
SwitchArrayFix.zip
(38.21 KiB) Downloaded 240 times

Re: Error after adding switches to Arduino project

Posted: Fri Dec 05, 2014 6:39 pm
by MJU
I'm sorry but this fix doesn't fix the issue. :roll: :roll:
I've put the fixed components in my V6 "components" directory, but get the same errors.

The file was created with 6.1 and the errors keep appearing.

Re: Error after adding switches to Arduino project

Posted: Sat Dec 13, 2014 6:34 pm
by MJU
No solution for this problem yet?

Re: Error after adding switches to Arduino project

Posted: Tue Jan 06, 2015 4:27 pm
by MJU
Bump.

Still no solution?
The previous didn't do the trick.

Re: Error after adding switches to Arduino project

Posted: Tue Jan 20, 2015 6:23 pm
by MJU
Bump....

Re: Error after adding switches to Arduino project

Posted: Wed Jan 21, 2015 1:05 pm
by Benj
Hello,

Hmm this one should have gone away. I will re-check. Edit I cannot replicate this problem so I think it should be fixed in the next update release.

You can work around the problem for now by adding this to the supplementary code in the project options.

#define PORTA PORTB
#define PINA PINB
#define DDRA DDRB