Hi Fabio,
Without commenting "ADCSRB = 0; //single shot" i can't compile project without errors.
I tried this solution:
#if defined(ADCSRB)
ADCSRB = 0; //single shot
#endif
And it works good.
Thanks!
AtmelStudio 7 atmega128 ChibiosHAL compile error
Moderator: tfAteba
Re: AtmelStudio 7 atmega128 ChibiosHAL compile error
Yes, that register is not even required. Talking about the bits in ADCSRB, the documentation states:
Since we don't set ADATE, I just removed the ADCSRB access on the code. Btw, the equivalent of ADATE on ATmega128 is ADFR, which has the same bit number but different name probably because there is no way to configure it (no equivalent to ADCSRB).
Thanks again Bogdan, bring it on!
Fabio Utzig
If ADATE in ADCSRA is written to one, the value of these bits selects which source will trigger an ADC conversion. If ADATE is cleared, the ADTS2:0 settings will have no effect.
Since we don't set ADATE, I just removed the ADCSRB access on the code. Btw, the equivalent of ADATE on ATmega128 is ADFR, which has the same bit number but different name probably because there is no way to configure it (no equivalent to ADCSRB).
Thanks again Bogdan, bring it on!
Fabio Utzig