Files

copied

There are no circuits or boards in this repository.

Last update 6 years 3 months by Petro Zhuk
Filessoftwareclock
..
Debug
I2C.c
I2c.h
Menu.h
brightness_senor.c
brightness_senor.h
clock.componentinfo.xml
clock.cproj
control.c
control.h
crc8.c
crc8.h
delay.c
delay.h
display.c
display.h
ds1307.c
ds1307.h
ds18x20.c
ds18x20.h
encoder.c
encoder.h
ledLight.c
ledLight.h
main.c
menu.c
onewire.c
onewire.h
wa2811.asm
ws2811.s
delay.c
/* Precise Delay Functions V 0.5, Martin Thomas, 9/2004 In the original Code from Peter Dannegger a timer-interrupt driven "timebase" has been used for precise One-Wire-Delays. My loop-approach is less elegant but may be more usable as library-function. Since it's not "timer-dependent" See also delay.h. Inspired by the avr-libc's loop-code */ #include <avr/io.h> #include <avr/io.h> #include <inttypes.h> #include "delay.h" void delayloop32(uint32_t loops) { __asm__ volatile ( "cp %A0,__zero_reg__ \n\t" \ "cpc %B0,__zero_reg__ \n\t" \ "cpc %C0,__zero_reg__ \n\t" \ "cpc %D0,__zero_reg__ \n\t" \ "breq L_Exit_%= \n\t" \ "L_LOOP_%=: \n\t" \ "subi %A0,1 \n\t" \ "sbci %B0,0 \n\t" \ "sbci %C0,0 \n\t" \ "sbci %D0,0 \n\t" \ "brne L_LOOP_%= \n\t" \ "L_Exit_%=: \n\t" \ : "=w" (loops) \ : "0" (loops) \ ); \ return; }
Report a bug