diff --git a/benchmarks/i2c_ssd1306_refresh.rb b/benchmarks/i2c_ssd1306_refresh.rb index 479ffe1..d56db3a 100644 --- a/benchmarks/i2c_ssd1306_refresh.rb +++ b/benchmarks/i2c_ssd1306_refresh.rb @@ -35,6 +35,13 @@ # ESP32-S3 : 51.8 fps (native USB) - Changed from 64 to 128 serial ACK interval # ESP32-C3 : 51.7 fps (native USB) - Changed from 64 to 128 serial ACK interval # +# July 27 2024 | i7 8700k CPU | CRuby 3.3.1 | 100 frames | Average of 3 runs +# +# ESP32-H2 : 7.3 fps (WCH UART bridge @ 115200, I2C @ 400kHz) +# ESP32-H2 : 10.9 fps (WCH UART bridge @ 230400, I2C @ 400kHz) +# ESP32-C6 : 8.0 fps (WCH UART bridge @ 115200, I2C @ 1MHz) +# ESP32-C6 : 13.2 fps (WCH UART bridge @ 230400, I2C @ 1MHz) +# require 'bundler/setup' require 'denko' diff --git a/src/lib/DenkoI2C.cpp b/src/lib/DenkoI2C.cpp index e6441f7..0afae9b 100644 --- a/src/lib/DenkoI2C.cpp +++ b/src/lib/DenkoI2C.cpp @@ -37,6 +37,14 @@ void Denko::i2cSetSpeed(uint8_t code) { default: Wire.setClock(100000); break; } i2cSpeed = code; + + // ESP32-H2 doesn't safely fallback if speed > 400kHz is chosen. + #ifdef CONFIG_IDF_TARGET_ESP32H2 + if (i2cSpeed > 1) { + i2cSpeed = 1; + Wire.setClock(400000); + } + #endif } // CMD = 33