Bug with V3 AVR using a subtraction calculation.

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

Moderators: Benj, Mods

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8324
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2380 times
Been thanked: 3391 times
Contact:

Bug with V3 AVR using a subtraction calculation.

Postby medelec35 » Fri Apr 29, 2011 12:49 pm

I posted a Flowchart for soccermad which was created with Flowcode V3 for PIC:
viewtopic.php?f=21&t=8335#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

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.