summaryrefslogtreecommitdiff
path: root/software/ttx/ttx.asm
diff options
context:
space:
mode:
Diffstat (limited to 'software/ttx/ttx.asm')
-rw-r--r--software/ttx/ttx.asm28
1 files changed, 27 insertions, 1 deletions
diff --git a/software/ttx/ttx.asm b/software/ttx/ttx.asm
index 2fe0268..260314d 100644
--- a/software/ttx/ttx.asm
+++ b/software/ttx/ttx.asm
@@ -141,7 +141,7 @@ ext_int_next
goto ext_int_next
ext_int_send_csum
- ;; TODO: send out csum
+ call rx_send_csum
movf RX_FSR_TMP,w
movwf FSR
swapf RX_CMD,w
@@ -442,6 +442,32 @@ rx_byte_next
goto rx_byte_clk_high
;; -------------------------------------
+rx_send_csum
+ bsf STATUS,RP0
+ bcf TRISIO,SDAT
+ bcf STATUS,RP0
+ movlw .8
+ movwf RX_BIT_CNT
+rx_send_clk_high
+ btfss GPIO,SCLK
+ goto rx_send_clk_high
+ btfss RX_CSUM,7
+ bcf GPIO,SDAT
+ btfsc RX_CSUM,7
+ bsf GPIO,SDAT
+ decfsz RX_BIT_CNT,f
+ goto rx_send_next
+
+ bsf STATUS,RP0
+ bsf TRISIO,SDAT
+ bcf STATUS,RP0
+ return
+
+rx_send_next
+ rlf RX_CSUM,f
+ goto rx_send_clk_high
+
+ ;; -------------------------------------
dottime
movwf TMR0
bcf INTCON,T0IF