From: ian Date: Sat, 26 Nov 2005 16:51:12 +0000 (+0000) Subject: correct handling of written bytes; slave panics on #; use movlw_movwf_spbrg because... X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=af186931df4223c3949dc6b73b0c01394f98d529;p=trains.git correct handling of written bytes; slave panics on #; use movlw_movwf_spbrg because it has error handling --- diff --git a/detpic/morse.messages b/detpic/morse.messages index 6606457..a785f20 100644 --- a/detpic/morse.messages +++ b/detpic/morse.messages @@ -29,7 +29,6 @@ TI3 ; for iwj TI4 ; for iwj TI5 ; for iwj X test-sofar:ch ; bad character received from host -XK i2clib:st ; test ZM i2clib:st,:sspstat,:sspcon1,:sspcon2 ; for testing ZS i2clib:st,:sspstat,:sspcon1,:st_orig ; for testing diff --git a/detpic/test-sofar.asm b/detpic/test-sofar.asm index 5430cd5..6ce7b67 100644 --- a/detpic/test-sofar.asm +++ b/detpic/test-sofar.asm @@ -165,9 +165,11 @@ serialu_read_char bra_nn m_ch_digit m_ch_notdigit - mov_lfsr 0x0200, 0 - mov_wf FSR0H ; prevent crashes due to wrapping - return + mov_fw ch + mov_wf POSTINC0 + clr_f INDF0 + clr_f FSR0H ; prevent crashes due to wrapping + bra m_buffer_fix_fsr0h ;---------- m_ch_bad @@ -205,9 +207,10 @@ m_ch_0 ;---------- m_buffer_reset + clr_f FSR0L +m_buffer_fix_fsr0h mov_lw 0x02 mov_wf FSR0H - clr_f FSR0L return ;---------------------------------------- @@ -266,6 +269,10 @@ i2csu_write_another xor_lw '!' bra_z s_buffer_erase + mov_fw t + xor_lw '#' + bra_z s_panic_req + mov_fw t mov_wf POSTINC0 bc_f FSR0L, s_bufbit @@ -304,6 +311,11 @@ s_buffer_reset mov_lfsr 0x300, 1 return +;---------- +s_panic_req + clr_f ch + panic morse_X + ;====================================================================== m_delay4 rcall m_delay2 @@ -327,8 +339,7 @@ serial_setup ; W undefined undefined mov_lw (1<