From fb1d9c464c8b50f3ed5ace4c0f782f5538615e50 Mon Sep 17 00:00:00 2001 From: Martin Guy Date: Sat, 10 Dec 2011 17:51:03 +0100 Subject: [PATCH] For new LCD firmware, drop need to limit data to 31 bytes The previous Mizar32 LCD firmware had a limit of 31 bytes per data message, while the new has no limit. This commit drops the code that used to split long data transfers into 31-byte chunks. --- src/platform/avr32/lcd.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/src/platform/avr32/lcd.c b/src/platform/avr32/lcd.c index 4587d722..2c77df30 100644 --- a/src/platform/avr32/lcd.c +++ b/src/platform/avr32/lcd.c @@ -43,21 +43,15 @@ static void lcd_stop() // "address" is LCD_CMD for LCD commands, LCD_DATA for LCD data. static int send_generic( u8 address, const u8 *data, int len ) { + lcd_start(); + i2c_start_cond(); + i2c_write_byte( address ); while ( len > 0 ) { - int nbytes; // number of bytes sent in this I2C packet - - lcd_start(); - i2c_start_cond(); - i2c_write_byte( address ); - // Mizar32 LCD module has a maximum of 31 bytes per data packet - nbytes = 0; - while ( len > 0 && nbytes < 31 ) { - i2c_write_byte( *data++ ); - nbytes++; len--; - } - i2c_stop_cond(); - lcd_stop(); + i2c_write_byte( *data++ ); + len--; } + i2c_stop_cond(); + lcd_stop(); return 0; }