mirror of
https://github.com/olikraus/u8g2.git
synced 2026-09-15 03:02: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();
|
||||
|
||||
Reference in New Issue
Block a user