From 6fc5dd12d27f5976af144b2b30974cab83567a4d Mon Sep 17 00:00:00 2001 From: Sean Kwok <45260108+Gitshaoxiang@users.noreply.github.com> Date: Tue, 25 Jan 2022 10:49:10 +0800 Subject: [PATCH] fixed wire begin overload bug --- .gitignore | 1 + examples/ATOM_BASE/ATOM_FLY/AtomFly.cpp | 2 +- src/M5Atom.cpp | 2 +- src/utility/MPU6886.cpp | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index e43b0f9..c120690 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .DS_Store +.vscode/* \ No newline at end of file diff --git a/examples/ATOM_BASE/ATOM_FLY/AtomFly.cpp b/examples/ATOM_BASE/ATOM_FLY/AtomFly.cpp index a0404d3..4d9d549 100644 --- a/examples/ATOM_BASE/ATOM_FLY/AtomFly.cpp +++ b/examples/ATOM_BASE/ATOM_FLY/AtomFly.cpp @@ -10,7 +10,7 @@ AtomFly::~AtomFly() void AtomFly::begin() { - Wire1.begin(25, 21, 10000); + Wire1.begin(25, 21, 100000UL); _bmp = new Adafruit_BMP280(&Wire1); diff --git a/src/M5Atom.cpp b/src/M5Atom.cpp index bc519af..c3b479e 100644 --- a/src/M5Atom.cpp +++ b/src/M5Atom.cpp @@ -20,7 +20,7 @@ void M5Atom::begin(bool SerialEnable, bool I2CEnable, bool DisplayEnable) if (I2CEnable) { - Wire.begin(25, 21, 100000); + Wire.begin(25, 21, 100000UL); } if (SerialEnable) { diff --git a/src/utility/MPU6886.cpp b/src/utility/MPU6886.cpp index 0d35eeb..ac8d138 100644 --- a/src/utility/MPU6886.cpp +++ b/src/utility/MPU6886.cpp @@ -32,7 +32,7 @@ int MPU6886::Init(void){ unsigned char tempdata[1]; unsigned char regdata; - Wire1.begin(25,21,100000); + Wire1.begin(25,21,100000UL); I2C_Read_NBytes(MPU6886_ADDRESS, MPU6886_WHOAMI, 1, tempdata); Serial.printf("%02X\r\n",tempdata[0]);