* device/include/pic16/pic18f[24][3456]k20.h,
[fw/sdcc] / device / lib / pic16 / libio / adc / adcbusy.c
index 9486da86e2f13f8650ac417c6aca735ea8820221..1636240041b40e0c23740f59f9f5726539194ffc 100644 (file)
@@ -25,6 +25,9 @@
 
 char adc_busy(void) __naked
 {
+#if defined(__SDCC_ADC_STYLE65J50)
+  WDTCONbits.ADSHR = 0; /* access ADCON0/1 */
+#endif
 #if 0
   return (ADCON0bits.GO);
 #else
@@ -32,7 +35,9 @@ char adc_busy(void) __naked
     movlw       0x00
 #if defined(__SDCC_ADC_STYLE242)
     btfsc       _ADCON0bits, 2
-#elif defined(__SDCC_ADC_STYLE1220) || defined(__SDCC_ADC_STYLE2220)
+#elif defined(__SDCC_ADC_STYLE1220) \
+   || defined(__SDCC_ADC_STYLE2220) \
+   || defined(__SDCC_ADC_STYLE65J50)
     btfsc       _ADCON0bits, 1
 #else /* unsupported ADC style */
 #error Unsupported ADC style.