From a8b7958a1a076808cb98a7d27098ffe370a0db6a Mon Sep 17 00:00:00 2001 From: lady ada Date: Tue, 2 Aug 2022 11:06:49 -0400 Subject: [PATCH] be more specific on fixing arduino i2c speeds --- .github/workflows/githubci.yml | 2 +- Adafruit_I2CDevice.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/githubci.yml b/.github/workflows/githubci.yml index 568eda2..3f97f62 100644 --- a/.github/workflows/githubci.yml +++ b/.github/workflows/githubci.yml @@ -29,4 +29,4 @@ jobs: run: bash ci/doxy_gen_and_deploy.sh - name: Test the code on supported platforms - run: python3 ci/build_platform.py main_platforms zero feather32u4 + run: python3 ci/build_platform.py main_platforms zero feather32u4 trinket_5v diff --git a/Adafruit_I2CDevice.cpp b/Adafruit_I2CDevice.cpp index 6b3d809..0c1ff70 100644 --- a/Adafruit_I2CDevice.cpp +++ b/Adafruit_I2CDevice.cpp @@ -261,7 +261,7 @@ uint8_t Adafruit_I2CDevice::address(void) { return _addr; } * Not necessarily that the speed was achieved! */ bool Adafruit_I2CDevice::setSpeed(uint32_t desiredclk) { -#if defined(__AVR__) // fix arduino core set clock +#if defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__) // fix arduino core set clock // calculate TWBR correctly uint8_t prescaler = 1; uint32_t atwbr = ((F_CPU / desiredclk) - 16) / 2;