summaryrefslogtreecommitdiff
path: root/software/idm
diff options
context:
space:
mode:
authorChristian Pointner <equinox@mur.at>2012-06-22 20:12:13 +0000
committerChristian Pointner <equinox@mur.at>2012-06-22 20:12:13 +0000
commitc7d481809a9827abbd2d73509b167c42cb841dc4 (patch)
tree2c8925f7299d1efaf8e628526166c78c730b6236 /software/idm
parentrx detect works, still receiving mostly noise (diff)
small refactoring
some time tests .. not working yet :( git-svn-id: https://svn.spreadspace.org/mur.sat@551 7de4ea59-55d0-425e-a1af-a3118ea81d4c
Diffstat (limited to 'software/idm')
-rw-r--r--software/idm/idm.asm38
1 files changed, 16 insertions, 22 deletions
diff --git a/software/idm/idm.asm b/software/idm/idm.asm
index 0782613..cb4ffcd 100644
--- a/software/idm/idm.asm
+++ b/software/idm/idm.asm
@@ -145,7 +145,9 @@ int_adc
movf TMP,w
movwf INDFW
incf TMP,f
+ movlb .0
call wbuf_next
+ bcf INT
goto int_fsr_norestore
;; void sspInterrupt()
@@ -180,15 +182,25 @@ int_spi
int_spi_0
btfss CMD_READ
retfie
+ movlb .0
call rbuf_next
- movf INDFR,w
btfss UNDERRUN
+ goto int_spi_0_loadnext
+ bsf INT
+ goto int_fsr_norestore
+
+int_spi_0_loadnext
+ movlb .4
+ movf INDFR,w
+ ;; incf TMP,f
+ ;; movf TMP,w
movwf SSP1BUF
goto int_fsr_norestore
int_spi_r
movf INDFR,w
btfss UNDERRUN
+ ;; movf TMP,w
movwf SSP1BUF
clrf CMDS
bsf CMD_READ
@@ -204,7 +216,7 @@ int_fsr_norestore
movwf FSR1H_SHAD
movf FSR1L,w
movwf FSR1L_SHAD
- retfie
+ retfie
;; -------------------------------------
;; SUBROUTINES
@@ -225,15 +237,10 @@ buf_init
movwf FSRRL
bcf OVERRUN
bsf UNDERRUN
-
- movf BSR,w
- clrf BSR
- bsf INT
if DEBUG == 1
bcf DBG1
bsf DBG2
endif
- movwf BSR
return
;; -------------------
@@ -254,13 +261,9 @@ wbuf_next
inc_fsr FSRW,FSRWH,FSRWL
bcf UNDERRUN
- movf BSR,w
- clrf BSR
- bcf INT
if DEBUG == 1
bcf DBG2
endif
- movwf BSR
movf FSRRH,w
xorwf FSRWH,w
@@ -272,10 +275,7 @@ endif
return
bsf OVERRUN
if DEBUG == 1
- movf BSR,w
- clrf BSR
bsf DBG1
- movwf BSR
endif
return
@@ -298,10 +298,7 @@ rbuf_next
inc_fsr FSRR,FSRRH,FSRRL
bcf OVERRUN
if DEBUG == 1
- movf BSR,w
- clrf BSR
bcf DBG1
- movwf BSR
endif
movf FSRWH,w
@@ -313,13 +310,9 @@ endif
btfss STATUS,Z
return
bsf UNDERRUN
- movf BSR,w
- clrf BSR
- bsf INT
if DEBUG == 1
bsf DBG2
endif
- movwf BSR
return
;; -------------------------------------
@@ -335,7 +328,7 @@ init
;; BANK 4
movlb .4
- movlw b'01000000'
+ movlw b'01000000' ; SMP=0,CKE=1
movwf SSP1STAT
movlw b'00010000'
movwf SSP1CON3
@@ -380,6 +373,7 @@ endif
movwf INTCON
bcf FILTER_EN
+ bsf INT
call buf_init
clrf CMDS
clrf TMP