geophone icon indicating copy to clipboard operation
geophone copied to clipboard

Two issues with Geophone on Arduino Due

Open catox0 opened this issue 9 years ago • 0 comments

(1) Multiple warnings on "narrowing conversion of [number] from 'int' to 'const int16_t in <twiddle_factors_256_br.h>

line 10: const int16_t twiddle_real[ 256 ] PROGMEM = line 46: const int16_t twiddle_imag[ 256 ] PROGMEM =

Adding compiler directived for MEGA and DUE removes the problem. E.g.:

Expand line 46 to:

if defined( ARDUINO_AVR_MEGA2560 )

const int16_t twiddle_imag[ 256 ] PROGMEM =

elif defined( ARDUINO_SAM_DUE )

const int twiddle_imag[ 256 ] PROGMEM =

endif


Expand line 10 to:

if defined( ARDUINO_AVR_MEGA2560 )

const int16_t twiddle_real[ 256 ] PROGMEM =

elif defined( ARDUINO_SAM_DUE )

const int twiddle_real[ 256 ] PROGMEM =

endif


(2) Invalid conversion from 'int' to 'eAnalogReference' in <Geophone.ino> line 1110: analogReference( DEFAULT );

According to the Arduino Due documentation, the analogReference() function is ignored on the Due.

Adding compiler directives restricting the analogReference to the MEGA removes the issue:

Expand line 1110 to:

#if defined( ARDUINO_AVR_MEGA2560 ) analogReference( DEFAULT );

#endif

catox0 avatar Aug 26 '16 11:08 catox0