From 04c5ade73257e17a43a76536fcd8c71b31ed7746 Mon Sep 17 00:00:00 2001 From: ian Date: Tue, 20 Dec 2005 23:18:06 +0000 Subject: [PATCH] actually reserve (with "res") nmra buffer; check for incoming message length overrun --- detpic/morse.messages | 1 + detpic/nmra-stream.asm | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/detpic/morse.messages b/detpic/morse.messages index 7166fd0..ea35a03 100644 --- a/detpic/morse.messages +++ b/detpic/morse.messages @@ -21,6 +21,7 @@ # Miscellaneous E ; `expected'; we were told to panic HX ::t ; host sent unknown command +HW ::t ; host sent message which was too long # Problematic interrupts IH INTCON,INTCON3,PIR1,PIR2,PIR3 ; Interrupt source not found (high pri.) diff --git a/detpic/nmra-stream.asm b/detpic/nmra-stream.asm index 9a8c675..32ac094 100644 --- a/detpic/nmra-stream.asm +++ b/detpic/nmra-stream.asm @@ -46,8 +46,8 @@ totrackbit res 1 ; bit location of pointer within byte bufferpage equ 5 - udata bufferpage << 256 -buffers res +buffer_section udata bufferpage << 256 +buffer res 256 code @@ -212,8 +212,16 @@ fixme need to check both interrupt handlers here and look for refies too inc_fa fromserial ; advance fromserial pointer by 1 byte ; debug '4' + mov_lw 0x0f + and_wfw fromserial + bra_z receive_message_too_long + bc_fa PIR1,RCIF ; unset interrupt - goto intrl_handled_nostack + intrl_handled_nostack + +receive_message_too_long + panic morse_HW + fixme reviewed up to here for inclusion in bigger program ; *** I *think* the interrupt bit is cleared by reading out of RCREG ; but this may be something to try in debugging if stuff doesn't work -- 2.30.2