summaryrefslogtreecommitdiff
path: root/Software
diff options
context:
space:
mode:
Diffstat (limited to 'Software')
-rw-r--r--Software/pinlock.asm46
1 files changed, 30 insertions, 16 deletions
diff --git a/Software/pinlock.asm b/Software/pinlock.asm
index 12c17d9..6625465 100644
--- a/Software/pinlock.asm
+++ b/Software/pinlock.asm
@@ -181,11 +181,11 @@ write_code:
; ret0 = Code digits 0-1
; ret1 = Code digits 2-3
load_code:
- ldi ret0, 0x01
- ldi ret1, 0x23
- sts 0, ret0
- sts 1, ret1
- ret
+ ;ldi ret0, 0x01
+ ;ldi ret1, 0x23
+ ;sts 0, ret0
+ ;sts 1, ret1
+ ;ret
push par0
push par1
; Digits 0-1
@@ -707,6 +707,7 @@ translate_map:
.equ HANDLE_STATE_AUTH = (0 << 2)
.equ HANDLE_STATE_AUTHED = (2 << 2)
.equ HANDLE_STATE_CHANGE = (1 << 2)
+.equ HANDLE_STATE_FAILED = (3 << 2)
handle:
push tmp0
push tmp1
@@ -715,15 +716,6 @@ handle:
andi tmp0, HANDLE_STATE_MASK
lsr tmp0
lsr tmp0
-
- push par0
- push par1
- ldi par0, 3
- mov par1, tmp0
- rcall display
- pop par1
- pop par0
-
ldi ZL, LOW(handle_map)
ldi ZH, HIGH(handle_map)
ldi tmp1, 0
@@ -735,6 +727,7 @@ handle_map:
;rjmp handle_authed
rjmp handle_change
rjmp handle_authed
+ rjmp handle_failed
handle_state:
push tmp0
ldi tmp0, HANDLE_STATE_MASK
@@ -880,7 +873,7 @@ handle_compare_end:
pop tmp1
pop tmp0
pop par0
- rjmp handle_end
+ rjmp handle_failed
handle_authed:
push par0
push par1
@@ -892,7 +885,7 @@ handle_authed:
inc par0
rcall display
inc par0
- ;rcall display
+ rcall display
pop par1
pop par0
cpi par1, 0xF0
@@ -973,6 +966,27 @@ handle_change_submit:
rcall handle_state
pop par0
rjmp handle_end
+handle_failed:
+ push par0
+ push par1
+ ldi par0, 0
+ ldi par1, 0x0F
+ rcall display
+ inc par0
+ rcall display
+ inc par0
+ rcall display
+ inc par0
+ rcall display
+ push par2
+ ldi par0, 20
+ ldi par1, 0xFF
+ ldi par2, 0xFF
+ rcall wait
+ pop par2
+ pop par1
+ pop par0
+ rjmp init
handle_end:
pop tmp1
pop tmp0