This is file Delay.c
This file is part of HX711 routines
//============================================================================== #include <pic.h> #include "Delay.h" //============================================================================== unsigned char _Delay_us( unsigned char t ) { asm( " clrf 3 " ); asm( "_Delay_us01: clrwdt " ); asm( " addlw -1 " ); asm( " btfsc 3,0 " ); asm( " goto _Delay_us01 " ); asm( " return " ); return t; } /*============================================================================*/ void Delay_ms( unsigned short t ) { asm( "clrf 3" ); asm( "movlw 250" ); asm( "clrwdt" ); asm( "nop" ); asm( "goto $+1" ); asm( "goto $+1" ); asm( "addlw -1" ); asm( "btfss 3, 2" ); asm( "goto $-6" ); asm( "movlw 249" ); asm( "clrwdt" ); asm( "nop" ); asm( "goto $+1" ); asm( "goto $+1" ); asm( "addlw -1" ); asm( "btfss 3, 2" ); asm( "goto $-6" ); asm( "nop" ); asm( "movf ?_Delay_ms+0,f" ); asm( "btfsc 3,2" ); asm( "decf ?_Delay_ms+1,f" ); asm( "decf ?_Delay_ms+0,f" ); asm( "movf ?_Delay_ms+0,w" ); asm( "iorwf ?_Delay_ms+1,w" ); asm( "btfss 3,2" ); asm( "goto $-24" ); } //==============================================================================