As requested, I have attached my "personal" library files.
They don't include the analogReadFast() function, so I have no problem with them.
But I get the problem after I move the inline analogReadFast() function from the analog_interface.h file to the sthudium.h file, by direct cut and paste.
/*================================================================================
: FILE: sthudium.h
: Author: sthudium
: Email: sthudium@mac.com
: Date: 12/20/2017
: Revision: version 1
: License: Public Domain
:
: Personal library header file
================================================================================*/
#ifndef sthudium_h
#define sthudium_h
#include "Arduino.h"
void printTitle( String sketchTitle, int baud );
void maxLoops( const unsigned long loops );
int inline analogReadFast(byte ADCpin)
{ ADC->CTRLA.bit.ENABLE = 0; // Disable ADC;
while( ADC->STATUS.bit.SYNCBUSY == 1 ); // Wait for synchronization;
ADC->CTRLB.reg = ADC_CTRLB_PRESCALER_DIV64 | // Divide Clock by 64;
ADC_CTRLB_RESSEL_10BIT;
ADC->AVGCTRL.reg = ADC_AVGCTRL_SAMPLENUM_1 | // 1 sample;
ADC_AVGCTRL_ADJRES(0x00ul); // Adjusting result by 0;
ADC->SAMPCTRL.reg = 0x00; // Sampling Time Length = 0;
ADC->CTRLA.bit.ENABLE = 1; // Enable ADC;
while( ADC->STATUS.bit.SYNCBUSY == 1 ); // Wait for synchronization;
return analogRead(ADCpin);
}
#endif //sthudium_h
BTW, it would have been much more helpful for you to post a link to the non-working sketch. I shouldn't have to do a bunch of work to reproduce your problem when you already have that code.