[SOLVED] Switch array and led array Atmega problem
Posted: Tue Dec 16, 2014 9:37 pm
When using component macro "read_all" and trying to send the value to led array "write value"... The simulation works fine, but sending code to chip returs many errors of not declared items.
This bug prevents use of some items on Flowcode and affects the code generated.
Chip used : Atmega168 and 328P
Ports on led array (8) Custom PINS: C5 C4 C3 C2 C1 C0 B1 B2
Ports on switch array (8) Custom PINS: B0 d7 D6 D5 D4 D3 D2 D0
Program structure (to reproduce):
Start
|
|
Forever loop
_|
Call component macro
sw_status=switch_array::ReadAll()
_|
Call component macro
Led_Array::WriteValue(sw_status)
_|
LOOP FOREVER-
|
End
Try to compile to chip/hex.
LOG:
This bug prevents use of some items on Flowcode and affects the code generated.
Chip used : Atmega168 and 328P
Ports on led array (8) Custom PINS: C5 C4 C3 C2 C1 C0 B1 B2
Ports on switch array (8) Custom PINS: B0 d7 D6 D5 D4 D3 D2 D0
Program structure (to reproduce):
Start
|
|
Forever loop
_|
Call component macro
sw_status=switch_array::ReadAll()
_|
Call component macro
Led_Array::WriteValue(sw_status)
_|
LOOP FOREVER-
|
End
Try to compile to chip/hex.
LOG:
Flowcode.msg.txt wrote: Tuodaan kääntäjää...
C:\Program Files (x86)\Flowcode 6\compilers\avr\batchfiles\avra.bat atmega168 "C:\Users\Jari\DOCUME~1\FLOWCODE\PLC-01\Hitachiohjelma.elf" "C:\Users\Jari\DOCUME~1\FLOWCODE\PLC-01\Hitachiohjelma.c" "C:\Users\Jari\DOCUME~1\FLOWCODE\PLC-01\Hitachiohjelma.lst"
Launching compiler...
C:\Users\Jari\DOCUME~1\FLOWCODE\PLC-01>"C:\PROGRA~2\FLOWCO~1\COMPIL~1\avr\BATCHF~1\..\bin\avr-gcc.exe" -mmcu=atmega168 -Os -funsigned-char -o "C:\Users\Jari\DOCUME~1\FLOWCODE\PLC-01\Hitachiohjelma.elf" "C:\Users\Jari\DOCUME~1\FLOWCODE\PLC-01\Hitachiohjelma.c" -lm
C:\Users\Jari\DOCUME~1\FLOWCODE\PLC-01\Hitachiohjelma.c: In function 'FCD_03d9a_led_base1__TurnOn':
C:\Users\Jari\DOCUME~1\FLOWCODE\PLC-01\Hitachiohjelma.c:592: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\Users\Jari\DOCUME~1\FLOWCODE\PLC-01\Hitachiohjelma.c:592: error: (Each undeclared identifier is reported only once
C:\Users\Jari\DOCUME~1\FLOWCODE\PLC-01\Hitachiohjelma.c:592: error: for each function it appears in.)
C:\Users\Jari\DOCUME~1\FLOWCODE\PLC-01\Hitachiohjelma.c:592: error: 'FCP_PORT_A' undeclared (first use in this function)
C:\Users\Jari\DOCUME~1\FLOWCODE\PLC-01\Hitachiohjelma.c: In function 'FCD_03d9a_led_base1__TurnOff':
C:\Users\Jari\DOCUME~1\FLOWCODE\PLC-01\Hitachiohjelma.c:602: error: 'FCP_TRIS_A' undeclared (first use in this function)
C:\Users\Jari\DOCUME~1\FLOWCODE\PLC-01\Hitachiohjelma.c:602: error: 'FCP_PORT_A' undeclared (first use in this function)
C:\Users\Jari\DOCUME~1\FLOWCODE\PLC-01\Hitachiohjelma.c: In function 'FCD_05261_switch_base1__ReadState':
C:\Users\Jari\DOCUME~1\FLOWCODE\PLC-01\Hitachiohjelma.cerror: 'FCP_PIN_A' undeclared (first use in this function)
C:\Users\Jari\DOCUME~1\FLOWCODE\PLC-01\Hitachiohjelma.cerror: 'FCP_TRIS_A' undeclared (first use in this function)
C:\Users\Jari\DOCUME~1\FLOWCODE\PLC-01\Hitachiohjelma.c: In function 'FCD_05261_switch_base1__WaitUntilHigh':
C:\Users\Jari\DOCUME~1\FLOWCODE\PLC-01\Hitachiohjelma.cerror: 'FCP_PIN_A' undeclared (first use in this function)
C:\Users\Jari\DOCUME~1\FLOWCODE\PLC-01\Hitachiohjelma.cerror: 'FCP_TRIS_A' undeclared (first use in this function)
C:\Users\Jari\DOCUME~1\FLOWCODE\PLC-01\Hitachiohjelma.c: In function 'FCD_05261_switch_base1__WaitUntilLow':
C:\Users\Jari\DOCUME~1\FLOWCODE\PLC-01\Hitachiohjelma.cerror: 'FCP_PIN_A' undeclared (first use in this function)
C:\Users\Jari\DOCUME~1\FLOWCODE\PLC-01\Hitachiohjelma.cerror: 'FCP_TRIS_A' undeclared (first use in this function)
Error returned from [avr-gcc.exe]
Completed compilation, return = 1
C:\Program Files (x86)\Flowcode 6\compilers\avr\batchfiles\avra.bat reported error code 1