structure and bit fields in FC

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

structure and bit fields in FC

Post by QMESAR »

Hi Team.

I normaly like to use structure for data and Flags in C code how can I do this in FC
example in C
structure Appflags
{
unsigned char RX_INT :1;
unsigned char Tx_INT :1;
unsigned char ControlOn :1;
{ Flags;
I can then call or use the structure example
Flags.ControlOn = 1 ;

my question is how to declare structures in FC and how to access them

Any help pointer is appreciated

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: structure and bit fields in FC

Post by Benj »

Hello Peter,

There currently isn't a nice way of doing this in Flowcode without resorting to using C code.

One way I have been playing with is to create a component with the variables you need and then create public macros to allow you to read and write the variables. If the macros are set to the embedded type (advanced) then there is a way to access the variable without the stack hit and extra instructions, this is how the DSP components function.

Once you have done this you then add the component to create an instance of the variables.

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: structure and bit fields in FC

Post by QMESAR »

Hello Ben.

OK thank you for the info ,
I think I stick by just using variables for now ,
I appreciate your help :D

Post Reply