summaryrefslogtreecommitdiff
path: root/software/idm/idm.asm
diff options
context:
space:
mode:
authorChristian Pointner <equinox@mur.at>2012-06-17 11:51:10 +0000
committerChristian Pointner <equinox@mur.at>2012-06-17 11:51:10 +0000
commitc171ed2cbb0d8dfdf7ce516c644da9f36582b18c (patch)
treec8f4b6b6ee19e15e798eccf1653b6e73802afe6f /software/idm/idm.asm
parentsome c-code translated to asm (diff)
idm cmd parsing
git-svn-id: https://svn.spreadspace.org/mur.sat@537 7de4ea59-55d0-425e-a1af-a3118ea81d4c
Diffstat (limited to 'software/idm/idm.asm')
-rw-r--r--software/idm/idm.asm30
1 files changed, 21 insertions, 9 deletions
diff --git a/software/idm/idm.asm b/software/idm/idm.asm
index f1cd094..6b41e3f 100644
--- a/software/idm/idm.asm
+++ b/software/idm/idm.asm
@@ -161,9 +161,29 @@ int_spi
movlb b'00000100'
movf SSP1BUF,w
movwf CMD
+ btfsc STATUS,Z
+ goto int_spi_0
+ movlw 'r'
+ xorwf CMD,w
+ btfsc STATUS,z
+ goto int_spi_r
+ ;; other commands
+ goto int_end
+int_spi_0
+ call rbuf_next
+ movf INDFR
+ btfss underrun
movwf SSP1BUF
+ goto int_end
+int_spi_r
+ movf INDFR
+ btfss underrun
+ movwf SSP1BUF
+ bsf CMD_READ
+ ;; goto int_end
+
int_end
movlb .31
movf FSR0H,w
@@ -189,11 +209,9 @@ int_end
buf_init
movlw BUF_STARTH
movwf FSRWH
- movlw BUF_STARTL
- movwf FSRWL
- movlw BUF_STARTH
movwf FSRRH
movlw BUF_STARTL
+ movwf FSRWL
movwf FSRRL
bcf OVERRUN
bsf UNDERRUN
@@ -201,7 +219,6 @@ buf_init
movf BSR,w
clrf BSR
- bsf INT
bsf DBG1
bcf DBG2
movwf BSR
@@ -315,7 +332,6 @@ init
bcf FILTER_EN
bsf INT
-
call buf_init
bsf T2CON,TMR2ON
@@ -324,12 +340,8 @@ init
;; -------------------------------------
;; MAINLOOP
main
- btfsc DBG0
goto main
- call rbuf_next
- goto main
-
;; -------------------------------------
;; END
end