Passing pointers to C macro modules

For C and ASSEMBLY users to post questions and code snippets for programming in C and ASSEMBLY. And for any other C or ASM course related questions.

Moderators: Benj, Mods

Post Reply
Pyhis
Posts: 2
Joined: Mon Aug 12, 2013 5:46 pm
Has thanked: 1 time
Contact:

Passing pointers to C macro modules

Post by Pyhis »

Hi

I am trying to use a function like this in flowcode. I am passing 4 variables and declaring pointers to them, and in the function I am
changing the values of the variables with pointers. Is this possible to make to a macro block or something similar? I am trying to avoid global variables.
If this is not possible, how would you do it?

Code: Select all

 char readDHT22(short *temp_integer, char *temp_decimal, char *hum_integer,char *hum_decimal) { 
Regards,
Kristian

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 63 times
Been thanked: 290 times
Contact:

Re: Passing pointers to C macro modules

Post by JonnyW »

Hello.

What version of Flowcode are you using? If you wish to pass variables like this to an existing C function in v5 or below you can use a C code icon. If you wish to create a Flowcode macro, this will only allow passing of parameters as strings at present.

This changes with v6 and you can pass arrays into macros no problems. Passing by-ref (so you can modify the values) is allowed.

We are going to an open Beta hopefully today so you will be able to download and test this. Keep an eye on this post for details.

Jonny

Pyhis
Posts: 2
Joined: Mon Aug 12, 2013 5:46 pm
Has thanked: 1 time
Contact:

Re: Passing pointers to C macro modules

Post by Pyhis »

How do you include your own .h and .c files to your project, so you can use the function with the C icon.

I really like visual representation of the flowcode, but I think it is a little too restricted.
There should be a place where you can include your own header files.

Kristian

Post Reply