Bug with V3 AVR using a subtraction calculation.

Forum for problems or queries regarding the Flowcode application and compiler usage.

Moderators: Benj, Mods

Post Reply
medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Bug with V3 AVR using a subtraction calculation.

Post by medelec35 »

I posted a Flowchart for soccermad which was created with Flowcode V3 for PIC:
http://www.matrixmultimedia.com/mmforum ... 335#p24232

It compiled for me fine with Flowcode V3 for PIC, but did not compile successfully when imported to V3 AVR

The following errors was shown within the message window:

Code: Select all

C:\Users\SANTAN~1\DOCUME~1\FLOWCODE\REMOTE working progress_Modified2.c: In function 'FCM_Timer0_intrerput':
C:\Users\SANTAN~1\DOCUME~1\FLOWCODE\REMOTE working progress_Modified2.c:168: error: expected expression before ';' token
C:\Users\SANTAN~1\DOCUME~1\FLOWCODE\REMOTE working progress_Modified2.c:257: error: expected expression before ';' token

Error returned from [avr-gcc.exe]

Return code = 1
On investigation I discovered two calculation boxes within timer interrupt was root cause :

Code: Select all

Seconds_Timer1 = Seconds_Timer1 - 1
&

Code: Select all

Seconds_Timer2 = Seconds_Timer2 - 1
These calculations had the following effect on the C file:

Code: Select all

//Calculation
				//Calculation:
				//  Seconds_Timer1 = Seconds_Timer1 - 1
				//  0 = 
				FCV_SECONDS_TIMER1 =  FCV_SECONDS_TIMER1 - 1 ;
				0 = ;

Code: Select all

//Calculation
				//Calculation:
				//  Seconds_Timer2 = Seconds_Timer2 - 1
				//  0 = 
				FCV_SECONDS_TIMER2 =  FCV_SECONDS_TIMER2 - 1 ;
				0 = ;
Solution which worked is replace Calculation boxes with a C code Boxes with

Code: Select all

FCV_SECONDS_TIMER1 =  FCV_SECONDS_TIMER1 - 1 ;
&
FCV_SECONDS_TIMER2 = FCV_SECONDS_TIMER2 - 1 ;
Bug was not present on Flowcode V4 AVR demo.

Martin
Martin

Post Reply