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;
32
32
static int _dacResolution = 12 ;
33
33
#else
34
34
static int _writeResolution = 8 ;
35
- static int _dacResolution = 8 ;
35
+ static int _dacResolution = 10 ;
36
36
#endif
37
37
38
38
@@ -368,9 +368,10 @@ void analogWrite(uint32_t pin, uint32_t value)
368
368
if (pin == PIN_A0 ) { // Only 1 DAC on A0 (PA02)
369
369
#endif
370
370
371
- value = mapResolution (value , _writeResolution , _dacResolution );
371
+ value = mapResolution (value , _writeResolution , _dacResolution );
372
372
373
373
#if defined(__SAMD51__ )
374
+
374
375
uint8_t channel = (pin == PIN_A0 ? 0 : 1 );
375
376
376
377
pinPeripheral (pin , PIO_ANALOG );
@@ -423,7 +424,6 @@ void analogWrite(uint32_t pin, uint32_t value)
423
424
424
425
425
426
#else
426
- value = mapResolution (value , _dacResolution , 10 );
427
427
syncDAC ();
428
428
DAC -> DATA .reg = value & 0x3FF ; // DAC on 10 bits.
429
429
syncDAC ();
You can’t perform that action at this time.
0 commit comments