summaryrefslogtreecommitdiff
path: root/Software
diff options
context:
space:
mode:
authorLeonard Kugis <leonard@kug.is>2020-08-31 15:45:37 +0200
committerLeonard Kugis <leonard@kug.is>2020-08-31 15:45:37 +0200
commitff865773c2edadbde7e57cc88d31ed2e4bc3924a (patch)
treee6345dfdaa9e9834a59373db6dbd62f9bdab659f /Software
parent9b1eb21f2bffaa3f42702cb73b9f19eae2fee761 (diff)
parent22787ade85e5943954bcb8963b332860d3fa3553 (diff)
Merge branch 'master' of collaborating.tuhh.de:cev7691/pinlock
Diffstat (limited to 'Software')
-rw-r--r--Software/pinlock.asm29
-rw-r--r--Software/pinlock.cof0
-rw-r--r--Software/pinlock.eep.hex1
-rw-r--r--Software/pinlock.hex14
-rw-r--r--Software/pinlock.objbin914 -> 0 bytes
5 files changed, 27 insertions, 17 deletions
diff --git a/Software/pinlock.asm b/Software/pinlock.asm
index ee80741..ba12dc9 100644
--- a/Software/pinlock.asm
+++ b/Software/pinlock.asm
@@ -5,6 +5,8 @@
.def cnt = r19
.def tmp1 = r20
.def tmp2 = r21
+.def ret0 = r22
+.def ret1 = r23
init:
ldi tmp0, HIGH(RAMEND)
@@ -18,7 +20,7 @@ init:
out DDRA, tmp0
ldi tmp0, 0b11111111
out DDRB, tmp0
- ldi tmp0, 0b11000000
+ ldi tmp0, 0b11101100
out DDRD, tmp0
ldi tmp0, 0b00000000
out PORTD, tmp0
@@ -39,6 +41,7 @@ init:
main:
ldi par0, 0b11111111
rcall status
+ rjmp [tmp0]
wait:
mov tmp0, par0
@@ -52,7 +55,10 @@ wait:
ret
; Output the status
+; Parameters:
; par0 = Status bits
+; Returns:
+; None
status:
ldi tmp0, 1
status_loop:
@@ -77,9 +83,12 @@ status_end:
brne status_loop
ret
-; Display the digit on a given display
+; Display the digit on a given display.
+; Parameters:
; par0 = Display number
; par1 = Digit
+; Returns:
+; None
display:
mov tmp0, par1
andi tmp0, 0x0F
@@ -124,3 +133,19 @@ display_3:
or tmp1, tmp0
out PORTB, tmp1
ret
+
+; Read the input buttons.
+; Parameters:
+; None
+; Returns:
+; ret0 = 123A456B
+; ret1 = 789C*0#D
+input:
+ ; Write selection rows
+ ldi tmp0, 1
+ ldi tmp1, 1
+input_loop:
+ mov tmp2, tmp0
+ and tmp2, tmp1
+ cp tmp1, tmp2
+ breq input_set
diff --git a/Software/pinlock.cof b/Software/pinlock.cof
deleted file mode 100644
index e69de29..0000000
--- a/Software/pinlock.cof
+++ /dev/null
diff --git a/Software/pinlock.eep.hex b/Software/pinlock.eep.hex
deleted file mode 100644
index 1996e8f..0000000
--- a/Software/pinlock.eep.hex
+++ /dev/null
@@ -1 +0,0 @@
-:00000001FF
diff --git a/Software/pinlock.hex b/Software/pinlock.hex
deleted file mode 100644
index 222b940..0000000
--- a/Software/pinlock.hex
+++ /dev/null
@@ -1,14 +0,0 @@
-:020000020000FC
-:1000000004E00EBF0FE51FEF2FEF17D00DBF0FEF6E
-:100010000ABB0FEF07BB00EC01BB00E002BB10E026
-:1000200020E027D011E021E024D012E022E021D00E
-:1000300013E023E01ED01FEF09D0012F1A95000016
-:10004000E1F7102F2A950000C1F7089501E0412F34
-:100050004023041729F04FE342BB4FEB42BB05C0DE
-:100060004FE742BB4FEF42BB00C0000F003079F7B3
-:100070000895022F0F70103039F0113051F0123006
-:1000800069F01330A1F008954BB3407F402B4BBB78
-:10009000089548B3407F402B48BB08954BB34F7041
-:1000A000000F000F000F000F402B4BBB089548B30B
-:1000B0004F70000F000F000F000F402B48BB08953A
-:00000001FF
diff --git a/Software/pinlock.obj b/Software/pinlock.obj
deleted file mode 100644
index 7c4452f..0000000
--- a/Software/pinlock.obj
+++ /dev/null
Binary files differ