summaryrefslogtreecommitdiff
path: root/software/ttx/ttx.asm
diff options
context:
space:
mode:
authorChristian Pointner <equinox@mur.at>2011-05-02 17:30:51 +0000
committerChristian Pointner <equinox@mur.at>2011-05-02 17:30:51 +0000
commit0ab2d2b6c0797eb3a284c8e417aa4a14f5632fad (patch)
treeecce042c9b2650133e8dfb08a2763e6df1652d0a /software/ttx/ttx.asm
parentttx: beacon interval (diff)
added subroutines section
git-svn-id: https://svn.spreadspace.org/mur.sat@6 7de4ea59-55d0-425e-a1af-a3118ea81d4c
Diffstat (limited to 'software/ttx/ttx.asm')
-rw-r--r--software/ttx/ttx.asm19
1 files changed, 14 insertions, 5 deletions
diff --git a/software/ttx/ttx.asm b/software/ttx/ttx.asm
index caaef8c..02ec011 100644
--- a/software/ttx/ttx.asm
+++ b/software/ttx/ttx.asm
@@ -36,9 +36,11 @@
;; -------------------------------------
;; DEFINES
-BEACON_INT EQU .60 ; send a beacon every 60 seconds
+BEACON_INT EQU .60
SECCNT EQU H'0008'
+CWOUT EQU GP0
+
;; -------------------------------------
;; OFFSET
org 0
@@ -50,11 +52,19 @@ init
movlw b'11110110'
option
movlw b'11111110'
- tris GPIO
- bsf GPIO,GP0
+ tris GPIO
+ bsf GPIO,CWOUT
clrf TMR0
movlw BEACON_INT
movwf SECCNT
+ goto main
+
+ ;; -------------------------------------
+ ;; SUBROUTINES
+send_beacon
+ movlw b'00000001'
+ xorwf GPIO,f
+ return
;; -------------------------------------
;; MAINLOOP
@@ -70,8 +80,7 @@ main
movwf SECCNT
;; this gets called every BEACON_INT seconds
- movlw b'00000001'
- xorwf GPIO,f
+ call send_beacon
;; is the timer above zero?
waitfor0