Page 1 of 1

Is it possible to add new functions in rp.h?

Posted: Wed Nov 21, 2018 2:48 pm
by adamS
Hi everyone,

Can I declare a new function in rp.h and define this function in rp.c,
then use this function in a C code.
If this can be done where is rp.c file?
I search all folders but only can find rp.h in /opt/redpitaya/include/redpitaya.
thanks!

Re: Is it possible to add new functions in rp.h?

Posted: Mon Nov 26, 2018 9:19 am
by Kilroy
Hi

It is possible, but I would not recommend it. Better way would be to create your own library as an extension to the existing one.

Use the git repository here https://github.com/RedPitaya/RedPitaya
You will find the source code in here https://github.com/RedPitaya/RedPitaya/ ... er/api/src

Regards
Uwe

Re: Is it possible to add new functions in rp.h?

Posted: Thu Nov 29, 2018 10:11 am
by adamS
Kilroy wrote:
Mon Nov 26, 2018 9:19 am
Hi

It is possible, but I would not recommend it. Better way would be to create your own library as an extension to the existing one.

Use the git repository here https://github.com/RedPitaya/RedPitaya
You will find the source code in here https://github.com/RedPitaya/RedPitaya/ ... er/api/src

Regards
Uwe
Hi, thanks for the reply!

When I use the function declared in rp.h (eg. rp_AcqReset()) and add some test line(like printf("HI")) in the rp.c source code( /opt/redpitaya/api/src/rp.c),

but when I run this rp_AcqReset() function the "HI" is not shown on terminal,
I don't know why...

Re: Is it possible to add new functions in rp.h?

Posted: Thu Nov 29, 2018 10:33 am
by Kilroy
Maybe the standard output is diverted to log file ...
I have not done things like that. I prefer to keep foreign software as is and add new features to my own software. That makes a later updating of the foreign software a lot easier.
Regards
Uwe