+ uint16_t offset;
+ uint8_t nibbles;
+ uint8_t i;
+
+ offset = (decode_hex(rx_buf[0])<<8) | (decode_hex(rx_buf[1])<<4) | decode_hex(rx_buf[2]);
+ nibbles = (offset&3);
+ offset >>= 2;
+ if(rx_fill>3+nibbles)
+ {
+ for(i=0; i<=nibbles; ++i)
+ {
+ uint16_t j = offset+nibbles-i;
+ uint8_t shift = 4*(j&1);
+ uint8_t bits = decode_hex(rx_buf[3+i]);
+ input[j/2] = (input[j/2]&~(0xF<<shift)) | (bits<<shift);
+ latch[j/2] = input[j/2];
+ }
+
+ lcd_gotoxy(19-offset-nibbles, 0);
+ for(i=0; i<=nibbles; ++i)
+ lcd_write(rx_buf[3+i]);
+ }