diff --git a/avr/MESSAGES b/avr/MESSAGES index 6bd2fc5..4ca1860 100644 --- a/avr/MESSAGES +++ b/avr/MESSAGES @@ -2,8 +2,8 @@ General Message Format ====================== -Currently messages can maximally use 14 bytes for data because: -- maximum buffer size if 16 bytes +Currently messages can maximally use 22 bytes for data because: +- maximum buffer size if 24 bytes - the internal buffer needs an additional flags byte - a message contains a checksum byte @@ -116,7 +116,7 @@ Offset Length Meaning 3 1 source address --------------------------------------------------------- 4 2 message number - 6 n up to 4 words to write at given address + 6 n up to 8 words to write at given address diff --git a/avr/com.asm b/avr/com.asm index 262015c..26b5ddf 100644 --- a/avr/com.asm +++ b/avr/com.asm @@ -28,7 +28,7 @@ .equ COM_REPEAT_VITAL = 255 .equ COM_BUFFER_NUM = 6 -.equ COM_BUFFER_SIZE = 16 ; CAVE: Need to change routine COM_BufferPosToY when changing this value!! +.equ COM_BUFFER_SIZE = 24 ; CAVE: Need to change routine COM_BufferPosToY when changing this value!! .equ COM_BUFFER_OFFS_FLAGS = 0 ; first byte in buffer is flags byte @@ -939,12 +939,19 @@ COM_BufferPosToY: lsl yl rol yh ; *2 + + add yl, r16 + adc yh, r17 ; *3 + lsl yl - rol yh ; *4 + rol yh ; *6 + lsl yl - rol yh ; *8 + rol yh ; *12 + lsl yl - rol yh ; *16 + rol yh ; *24 + ; add base position of buffers ldi r16, LOW(comRecvBuffers) ldi r17, HIGH(comRecvBuffers)