iNavFlight / inav

INAV: Navigation-enabled flight control software
https://inavflight.github.io
GNU General Public License v3.0
3.2k stars 1.49k forks source link

Compilation fails if USE_SERIALRX_SPEKTRUM is not defined #1361

Closed giacomo892 closed 7 years ago

giacomo892 commented 7 years ago

I've tried to compile a custom version for my NAZE target without Serial RX enabled since I don't use it. In target/common.h I can compile if:

define USE_RX_PWM

define USE_RX_PPM

//#define SERIAL_RX

define USE_SERIALRX_SPEKTRUM // Cheap and fairly common protocol

//#define USE_SERIALRX_SBUS // Very common protocol //#define USE_SERIALRX_IBUS // Cheap FlySky & Turnigy receive

Still saving lot of space, but cannot compile if I remove SPEKTRUM support like this:

define USE_RX_PWM

define USE_RX_PPM

//#define SERIAL_RX //#define USE_SERIALRX_SPEKTRUM // Cheap and fairly common protocol //#define USE_SERIALRX_SBUS // Very common protocol //#define USE_SERIALRX_IBUS // Cheap FlySky & Turnigy receive

The error is:

Linking NAZE /tmp/cc7PTBML.ltrans0.ltrans.o: In function init': /home/giacomo/Scrivania/inav/./src/main/fc/fc_init.c:219: undefined reference tospektrumBind' collect2: error: ld returned 1 exit status Makefile:846: set di istruzioni per l'obiettivo "obj/main/inav_NAZE.elf" non riuscito make: *** [obj/main/inav_NAZE.elf] Errore 1

PS: Removing PWM support (which I don't use gives a warning about an used variable but I think that's ok).

stronnag commented 7 years ago

Maybe there are some SPEKTRUM bind defines that need to removed.

giacomo892 commented 7 years ago

USE_SERIALRX_SPEKTRUM should disable completely SPEKTRUM so there is something nasty about this :)

DzikuVx commented 7 years ago

@giacomo892 I was able to compile NAZE with following defines

#define USE_RX_PWM
#define USE_RX_PPM
// #define SERIAL_RX
// #define USE_SERIALRX_SPEKTRUM   // Cheap and fairly common protocol
// #define USE_SERIALRX_SBUS       // Very common protocol
// #define USE_SERIALRX_IBUS       // Cheap FlySky & Turnigy receivers

No errors, so I assume we can close it

giacomo892 commented 7 years ago

Yes. Now it works. Don't really know why.

@DzikuVx try to build with:

#define SERIAL_RX
#define USE_SERIALRX_SPEKTRUM   // Cheap and fairly common protocol
//#define USE_SERIALRX_SBUS       // Very common protocol
//#define USE_SERIALRX_IBUS       // Cheap FlySky & Turnigy receivers

same as

#define SERIAL_RX
//#define USE_SERIALRX_SPEKTRUM   // Cheap and fairly common protocol
//#define USE_SERIALRX_SBUS       // Very common protocol
#define USE_SERIALRX_IBUS       // Cheap FlySky & Turnigy receivers

you will get an error (but compiles) . maybe you can easily fix it :)

thanks

DzikuVx commented 7 years ago

Those are only warnings, not errors. I suppose we can live with them for a while

giacomo892 commented 7 years ago

ok, maybe we should rename this issue just to use it as todo :)