diff options
author | Christian Pointner <equinox@mur.at> | 2013-07-27 00:18:03 +0000 |
---|---|---|
committer | Christian Pointner <equinox@mur.at> | 2013-07-27 00:18:03 +0000 |
commit | 976f4448944685e437a4c8bf34fab83cad6ac371 (patch) | |
tree | db6437e26ee98857d6f388d1acba788f61c0fc3b /software/ihu/ihu.asm | |
parent | updated copyright (diff) |
added bat interrupt and spi stub
git-svn-id: https://svn.spreadspace.org/mur.sat@817 7de4ea59-55d0-425e-a1af-a3118ea81d4c
Diffstat (limited to 'software/ihu/ihu.asm')
-rw-r--r-- | software/ihu/ihu.asm | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/software/ihu/ihu.asm b/software/ihu/ihu.asm index 1b483e1..b9cbdad 100644 --- a/software/ihu/ihu.asm +++ b/software/ihu/ihu.asm @@ -145,6 +145,7 @@ STATUS_TEMP EQU H'007F' goto interrupt_end int_ctr + ;; TODO: get byte from CTR (via SPI) bcf INTCON,INTF goto interrupt_end @@ -152,6 +153,13 @@ int_ctr int_portchange btfsc RTC_RST call rtc_init + btfsc BAT_INT + goto int_bat + bcf INTCON,RBIF + goto interrupt_end + +int_bat + ;; TODO: get byte from BAT (via SPI) bcf INTCON,RBIF goto interrupt_end @@ -197,8 +205,8 @@ init bcf STATUS,RP1 movlw b'00111111' ; Weak Pull-UPS for movwf WPUB ; RTC_RST, DEPLOY, CAPGOOD, POWER_FAIL, BAT_INT, CTR_INT - movlw b'00100000' ; Port Change Interrup on - movwf IOCB ; RTC_RST + movlw b'00101000' ; Port Change Interrup on + movwf IOCB ; RTC_RST, BAT_INT movlw b'00000010' ; Weak-Pull-UPs enabled, INT -> falling edge, TMR0 internal clock movwf OPTION_REG ; Prescaler @ TMR0, Prescaler 1:8 clrf PSTRCON ; disable pulse steering @@ -240,6 +248,7 @@ init movwf INTCON call i2c_init + call spi_init clrf TMR0 clrf TMP bsf INTCON,GIE @@ -278,6 +287,9 @@ wait_loop include "rtc.inc" ;; ------------------------------------- + include "spi.inc" + + ;; ------------------------------------- ;; include "temp.inc" ;; ------------------------------------- |