fixed 32 byte buffer issue with Wire.h

This commit is contained in:
olikraus
2016-05-15 09:56:06 +02:00
parent 28d5de8d25
commit ebfaf993d4
15 changed files with 63 additions and 26 deletions
+3 -10
View File
@@ -41,7 +41,7 @@
#ifdef U8X8_HAVE_HW_SPI
#include <SPI.h>
#endif
#ifdef U8X8_HAVE_HW_TWI
#ifdef U8X8_HAVE_HW_I2C
#include <Wire.h>
#endif
@@ -166,19 +166,12 @@ extern "C" uint8_t u8x8_byte_arduino_hw_spi(u8x8_t *u8g2, uint8_t msg, uint8_t a
extern "C" uint8_t u8x8_byte_arduino_hw_i2c(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)
{
#ifdef U8X8_HAVE_HW_TWI
#ifdef U8X8_HAVE_HW_I2C
uint8_t *data;
switch(msg)
{
case U8X8_MSG_BYTE_SEND:
//Wire.write((uint8_t *)arg_ptr, (int)arg_int);
data = (uint8_t *)arg_ptr;
while( arg_int > 0 )
{
Wire.write(*data);
data++;
arg_int--;
}
Wire.write((uint8_t *)arg_ptr, (int)arg_int);
break;
case U8X8_MSG_BYTE_INIT:
Wire.begin();
+4 -4
View File
@@ -49,22 +49,22 @@
#define U8X8_HAVE_HW_SPI
/* Assumption: All Arduino Boards have "TWI.h" */
#define U8X8_HAVE_HW_TWI
/* Assumption: All Arduino Boards have "Wire.h" */
#define U8X8_HAVE_HW_I2C
/* Undefine U8X8_HAVE_HW_SPI for those Boards without SPI.h */
#ifdef ARDUINO_AVR_DIGISPARK
#ifdef U8X8_HAVE_HW_SPI
#undef U8X8_HAVE_HW_SPI
#undef U8X8_HAVE_HW_TWI
#undef U8X8_HAVE_HW_I2C
#endif
#endif
#ifdef __AVR_ATtiny85__
#ifdef U8X8_HAVE_HW_SPI
#undef U8X8_HAVE_HW_SPI
#undef U8X8_HAVE_HW_TWI
#undef U8X8_HAVE_HW_I2C
#endif
#endif