tm3d
/
owSlave2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change from 16 to 24 Byte Config Code
[owSlave2.git]
/
common
/
OWTimerInterrupt.s
diff --git
a/common/OWTimerInterrupt.s
b/common/OWTimerInterrupt.s
index
1ad0afc
..
349be8a
100644
(file)
--- a/
common/OWTimerInterrupt.s
+++ b/
common/OWTimerInterrupt.s
@@
-1,4
+1,4
@@
-// Copyright (c) 201
5
, Tobias Mueller tm(at)tm3d.de
\r
+// Copyright (c) 201
7
, Tobias Mueller tm(at)tm3d.de
\r
// All rights reserved.
\r
//
\r
// Redistribution and use in source and binary forms, with or without
\r
// All rights reserved.
\r
//
\r
// Redistribution and use in source and binary forms, with or without
\r
@@
-37,17
+37,23
@@
TIMER_INTERRUPT:
push r_temp
\r
in r_temp,_SFR_IO_ADDR(SREG)
\r
push r_temp
\r
push r_temp
\r
in r_temp,_SFR_IO_ADDR(SREG)
\r
push r_temp
\r
+ push r_temp2
\r
cdb
\r
sbic OW_PIN,OW_PINN ; abkuerzung wenn Leitung schon h
\r
rjmp tint_end ; Leitung 1 kein Reset
\r
ldi r_temp,0
\r
out TCNT_REG,r_temp
\r
CLEAR_TOV_FLAG
\r
cdb
\r
sbic OW_PIN,OW_PINN ; abkuerzung wenn Leitung schon h
\r
rjmp tint_end ; Leitung 1 kein Reset
\r
ldi r_temp,0
\r
out TCNT_REG,r_temp
\r
CLEAR_TOV_FLAG
\r
+ ldi r_temp2,3 ;3x overrun for timeout
\r
tint_loop_rend:
\r
tint_loop_rend:
\r
+ JMP_NO_TOV ;ueberspringe wenn kein ueberlauf
\r
+ rjmp tint_handle_timeout
\r
sbis OW_PIN,OW_PINN ;warten bis leitung wieder h
\r
rjmp tint_loop_rend
\r
sbis OW_PIN,OW_PINN ;warten bis leitung wieder h
\r
rjmp tint_loop_rend
\r
- JMP_NO_TOV ;ueberspringe wenn kein ueberlauf
\r
- rjmp tint_overrun
\r
+ ;JMP_NO_TOV ;ueberspringe wenn kein ueberlauf
\r
+ cpi r_temp2,3
\r
+ ;rjmp tint_overrun
\r
+ brne tint_overrun
\r
in r_temp,TCNT_REG ;schauen ob es lange genug gedauert hat fuer reset
\r
cpi r_temp,OWT_RESET2
\r
brlo tint_end
\r
in r_temp,TCNT_REG ;schauen ob es lange genug gedauert hat fuer reset
\r
cpi r_temp,OWT_RESET2
\r
brlo tint_end
\r
@@
-79,8
+85,15
@@
tint_loop_pres:
tint_end:
\r
;CLEAR_INTERRUPT_FLAG
\r
DIS_TIM_INT
\r
tint_end:
\r
;CLEAR_INTERRUPT_FLAG
\r
DIS_TIM_INT
\r
+ pop r_temp2
\r
pop r_temp
\r
out _SFR_IO_ADDR(SREG),r_temp
\r
pop r_temp
\r
reti
\r
;;;
\r
pop r_temp
\r
out _SFR_IO_ADDR(SREG),r_temp
\r
pop r_temp
\r
reti
\r
;;;
\r
+
\r
+tint_handle_timeout:
\r
+ dec r_temp2
\r
+ breq tint_end
\r
+ CLEAR_TOV_FLAG
\r
+ rjmp tint_loop_rend
\ No newline at end of file