* src/pic16/device.c (Pics16[]): added devices 18F2550, 18F4331,
[fw/sdcc] / device / lib / pic16 / libio / adc / adcbusy.c
index 5328c31456a07512f1d0c547272af5a92bd83c5f..ae8dd58aeea7cb45353347e44a116b63008394ec 100644 (file)
@@ -4,7 +4,16 @@
 #include <adc.h>
 
 
-char adc_busy(void)
+char adc_busy(void) _naked
 {
-       return (ADCON0bits.GO == 1);
+#if 1
+  return (ADCON0bits.GO);
+#else
+  _asm
+    movlw       0x00
+    btfsc       _ADCON0bits, 2
+    addlw       0x01
+    return
+  _endasm;
+#endif
 }