Changeset 224 for rtos_arduino/trunk/arduino_lib/hardware/arduino/samd/cores/arduino/wiring_analog.c
- Timestamp:
- Apr 30, 2016, 11:29:25 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
rtos_arduino/trunk/arduino_lib/hardware/arduino/samd/cores/arduino/wiring_analog.c
r175 r224 31 31 static int DAC_RESOLUTION = 10; 32 32 33 // Wait for synchronization of registers between the clock domains34 static __inline__ void syncDAC() __attribute__((always_inline, unused));35 static void syncDAC() {36 while (DAC->STATUS.bit.SYNCBUSY == 1)37 ;38 }39 40 33 void analogReadResolution(int res) { 41 34 _readResolution = res; 42 35 while( ADC->STATUS.bit.SYNCBUSY == 1 ) 43 36 { 44 // Waiting for synchro inization37 // Waiting for synchronization 45 38 } 46 39 if(res == 8) ADC->CTRLB.bit.RESSEL= ADC_CTRLB_RESSEL_8BIT_Val; … … 69 62 while( ADC->STATUS.bit.SYNCBUSY == 1 ) 70 63 { 71 // Waiting for synchro inization64 // Waiting for synchronization 72 65 } 73 66 switch(ulMode) … … 91 84 while( ADC->STATUS.bit.SYNCBUSY == 1 ) 92 85 { 93 // Waiting for synchro inization86 // Waiting for synchronization 94 87 } 95 88 } … … 154 147 DAC->DATA.reg = ulValue & 0x3FF; // Dac on 10 bits. 155 148 DAC->CTRLA.bit.ENABLE = 1; // DAC Enabled 156 syncDAC();149 while (DAC->STATUS.bit.SYNCBUSY == 1); //wait for synchronization 157 150 return; 158 151 }
Note:
See TracChangeset
for help on using the changeset viewer.