summaryrefslogtreecommitdiff
path: root/software/idm/idm.asm
diff options
context:
space:
mode:
authorChristian Pointner <equinox@mur.at>2012-06-22 01:25:36 +0000
committerChristian Pointner <equinox@mur.at>2012-06-22 01:25:36 +0000
commit42dd6c4ebb16f1ad2f0acf0c831577db7e7c3c5c (patch)
treede59bca24b0dcc8e222172f3094ff5dcfcdd3be3 /software/idm/idm.asm
parentdecimal is better than binary for page numbers (diff)
moved cmd flags to own byte
git-svn-id: https://svn.spreadspace.org/mur.sat@549 7de4ea59-55d0-425e-a1af-a3118ea81d4c
Diffstat (limited to 'software/idm/idm.asm')
-rw-r--r--software/idm/idm.asm22
1 files changed, 15 insertions, 7 deletions
diff --git a/software/idm/idm.asm b/software/idm/idm.asm
index 0bd6007..0782613 100644
--- a/software/idm/idm.asm
+++ b/software/idm/idm.asm
@@ -69,13 +69,16 @@ BUF_ENDL EQU H'00BF'
CMD EQU H'0070'
TMP EQU H'0071'
+CMDS EQU H'007E'
FLAGS EQU H'007F'
;; bits
+;; CMDS
+#define CMD_READ CMDS,0
+
;; FLAGS
#define UNDERRUN FLAGS,0
#define OVERRUN FLAGS,1
-#define CMD_READ FLAGS,7
;; -------------------------------------
;; Macros
@@ -171,7 +174,7 @@ int_spi
btfsc STATUS,Z
goto int_spi_r
;; other commands
- bcf CMD_READ
+ clrf CMDS
retfie
int_spi_0
@@ -187,6 +190,7 @@ int_spi_r
movf INDFR,w
btfss UNDERRUN
movwf SSP1BUF
+ clrf CMDS
bsf CMD_READ
retfie
@@ -221,7 +225,6 @@ buf_init
movwf FSRRL
bcf OVERRUN
bsf UNDERRUN
- bcf CMD_READ
movf BSR,w
clrf BSR
@@ -378,16 +381,14 @@ endif
bcf FILTER_EN
call buf_init
-
+ clrf CMDS
clrf TMP
bsf INTCON,GIE
-
+
;; -------------------------------------
;; MAINLOOP
main
- btfsc CS
- bcf CMD_READ
if DEBUG == 1
bcf SPEAKER
btfss DBG0
@@ -401,6 +402,13 @@ enable_t1
btfss T1CON,TMR1ON
bsf T1CON,TMR1ON
endif
+ btfss CS
+ goto main
+
+powerdown:
+ clrf CMDS
+ ;; sleep
+ ;; nop
goto main
;; -------------------------------------