Skip to content

Commit a8b7958

Browse files
committed
be more specific on fixing arduino i2c speeds
1 parent a493f3d commit a8b7958

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

.github/workflows/githubci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ jobs:
2929
run: bash ci/doxy_gen_and_deploy.sh
3030

3131
- name: Test the code on supported platforms
32-
run: python3 ci/build_platform.py main_platforms zero feather32u4
32+
run: python3 ci/build_platform.py main_platforms zero feather32u4 trinket_5v

Adafruit_I2CDevice.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ uint8_t Adafruit_I2CDevice::address(void) { return _addr; }
261261
* Not necessarily that the speed was achieved!
262262
*/
263263
bool Adafruit_I2CDevice::setSpeed(uint32_t desiredclk) {
264-
#if defined(__AVR__) // fix arduino core set clock
264+
#if defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__) // fix arduino core set clock
265265
// calculate TWBR correctly
266266
uint8_t prescaler = 1;
267267
uint32_t atwbr = ((F_CPU / desiredclk) - 16) / 2;

0 commit comments

Comments
 (0)