File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ static int _writeResolution = 12;
3232static int _dacResolution = 12 ;
3333#else
3434static int _writeResolution = 8 ;
35- static int _dacResolution = 8 ;
35+ static int _dacResolution = 10 ;
3636#endif
3737
3838
@@ -368,9 +368,10 @@ void analogWrite(uint32_t pin, uint32_t value)
368368 if (pin == PIN_A0 ) { // Only 1 DAC on A0 (PA02)
369369#endif
370370
371- value = mapResolution (value , _writeResolution , _dacResolution );
371+ value = mapResolution (value , _writeResolution , _dacResolution );
372372
373373#if defined(__SAMD51__ )
374+
374375 uint8_t channel = (pin == PIN_A0 ? 0 : 1 );
375376
376377 pinPeripheral (pin , PIO_ANALOG );
@@ -423,7 +424,6 @@ void analogWrite(uint32_t pin, uint32_t value)
423424
424425
425426#else
426- value = mapResolution (value , _dacResolution , 10 );
427427 syncDAC ();
428428 DAC -> DATA .reg = value & 0x3FF ; // DAC on 10 bits.
429429 syncDAC ();
You can’t perform that action at this time.
0 commit comments