From 0ab2d2b6c0797eb3a284c8e417aa4a14f5632fad Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Mon, 2 May 2011 17:30:51 +0000 Subject: added subroutines section git-svn-id: https://svn.spreadspace.org/mur.sat@6 7de4ea59-55d0-425e-a1af-a3118ea81d4c --- software/ttx/ttx.asm | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'software/ttx') 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 -- cgit v1.2.3