mirror of
https://github.com/olikraus/u8g2.git
synced 2026-09-14 10:42:52 +00:00
fixed 32 byte buffer issue with Wire.h
This commit is contained in:
+3
-10
@@ -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
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user