avr: beautifications.
This commit is contained in:
@@ -8,7 +8,10 @@
|
||||
; ***************************************************************************
|
||||
|
||||
|
||||
.equ MOTIONLIGHT_DEFAULT_ONTIME = 3000 ; 5min
|
||||
; ***************************************************************************
|
||||
; defines
|
||||
|
||||
.equ MOTIONLIGHT_DEFAULT_ONTIME = 3000 ; 5min (in 1/10 secs)
|
||||
|
||||
.equ MOTIONLIGHT_SOURCE_NUM = 2
|
||||
|
||||
@@ -17,6 +20,10 @@
|
||||
.equ MOTIONLIGHT_SOURCE_SIZE = 2
|
||||
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; data
|
||||
|
||||
.dseg
|
||||
|
||||
|
||||
@@ -30,6 +37,9 @@ motionLightDataEnd:
|
||||
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; code
|
||||
|
||||
.cseg
|
||||
|
||||
MOTIONLIGHT_BEGIN:
|
||||
@@ -88,15 +98,12 @@ MotionLight_Fini:
|
||||
MotionLight_Every100ms:
|
||||
lds r24, motionLightTimer
|
||||
lds r25, motionLightTimer+1
|
||||
mov r16, r24
|
||||
or r16, r25
|
||||
brne MotionLight_Every100ms_dec
|
||||
ret
|
||||
MotionLight_Every100ms_dec:
|
||||
sbiw r25:r24, 1
|
||||
brcs MotionLight_Every100ms_ret
|
||||
sts motionLightTimer, r24
|
||||
sts motionLightTimer+1, r25
|
||||
breq MotionLight_Every100ms_off
|
||||
MotionLight_Every100ms_ret:
|
||||
ret
|
||||
MotionLight_Every100ms_off:
|
||||
rjmp motionLightTurnOff ; (r16, r17, r18, r19, r20, r21, r23)
|
||||
|
||||
Reference in New Issue
Block a user