Skip to content
Snippets Groups Projects
Commit 806c3303 authored by Claudio Indellicati's avatar Claudio Indellicati Committed by Cristian Maglie
Browse files

Fixed register synchronization in 'analogReadResolution()'.

parent 3912d9d8
No related branches found
No related tags found
No related merge requests found
/*
Copyright (c) 2014 Arduino. All right reserved.
Copyright (c) 2014 Arduino LLC. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -57,7 +57,6 @@ static void syncTCC(Tcc* TCCx) {
void analogReadResolution( int res )
{
_readResolution = res ;
syncADC();
if (res > 10)
{
ADC->CTRLB.bit.RESSEL = ADC_CTRLB_RESSEL_12BIT_Val;
......@@ -73,6 +72,7 @@ void analogReadResolution( int res )
ADC->CTRLB.bit.RESSEL = ADC_CTRLB_RESSEL_8BIT_Val;
_ADCResolution = 8;
}
syncADC();
}
void analogWriteResolution( int res )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment