Compiling Error of AVR-V4 FlowCode files in V5

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
Niro
Posts: 77
Joined: Mon Jan 03, 2011 8:58 pm
Has thanked: 29 times
Been thanked: 10 times

Compiling Error of AVR-V4 FlowCode files in V5

Post by Niro »

Hi all,

first of all, V5 is a great improvement to V4 and it really helps saving programming time!!

Trying to compile an AVR V4-File into V5 I had some problems with local varibles within some c-code routines.

To make it clear, I compiled a simple FC-File with one global variable: GlobalTest
and a macro called Test with a local variable: LocalTest

V4 was compiling locals this way: *************************************

//Variable declarations
volatile char FCV_GLOBALTEST;

//Macro implementations

void FCM_Test()
{
//Local variable definitions
char FCL_LOCALTEST;

//Calculation
//Calculation:
// Test.LocalTest = GlobalTest
FCL_LOCALTEST = FCV_GLOBALTEST;
}

V5 is compiling locals this way: ***********************************

//Variable declarations
volatile MX_UINT8 FCV_GLOBALTEST;

//Macro implementations

void FCM_test()
{
//Local variable definitions
MX_UINT8 FCL_TEST_LOCALTEST;

//Calculation
//Calculation:
// .LocalTest = GlobalTest
FCL_TEST_LOCALTEST = FCV_GLOBALTEST;
}

****************

Now it seems that the locals have changed from "FCL_LOCALTEST" to "FCL_TEST_LOCALTEST" (now including the name of the macro).

That is quite a big problem changing all occurrences manually to get the implemented c-code working with V5.

I'd really appreciate all suggestion solving this problem!!

Many thanks,
Niro

User avatar
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: Compiling Error of AVR-V4 FlowCode files in V5

Post by Benj »

Hello Niro,

You should be able to get the computer to do most of the work here.

Download a text editor like textpad (thats what I use here at matrix).

Create a new file and paste the code into the editor,

Now find something common that you want to change

eg.
FCL_

Next highlight all of the text inside the current local macro.

Next click on Search -> Replace

In the Find What box insert your common code. FCL_

In the Replace With box insert the common code plus the macro name. FCL_TEST_

Ensure the Selected text radio button is selected and click replace all to do every instance in the selected area or replace next to allow you to go through one at a time to ensure you don't make any errors.

"MX_UINT8" and "char" should be interchangeable so don't worry too much about this.

Finally paste the code back into the Flowcode C icon.

You may also be able to search and replace on the C code directly in v5 but i'm not 100% sure about this.

Hope this helps.

Post Reply