summaryrefslogtreecommitdiff
path: root/software/idm
diff options
context:
space:
mode:
Diffstat (limited to 'software/idm')
-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
;; -------------------------------------