Skip to content

Commit c7f7c0d

Browse files
committed
Reduce compile warning
1 parent ec6039f commit c7f7c0d

File tree

5 files changed

+6
-19
lines changed

5 files changed

+6
-19
lines changed

src/M5Display.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ void M5Display::drawBmpFile(fs::FS &fs, const char *path, uint16_t x, uint16_t y
161161
uint8_t* bptr = lineBuffer;
162162
uint16_t* tptr = (uint16_t*)lineBuffer;
163163
// Convert 24 to 16 bit colours
164-
for (uint16_t col = 0; col < w; col++) {
164+
for (col = 0; col < w; col++) {
165165
b = *bptr++;
166166
g = *bptr++;
167167
r = *bptr++;

src/utility/CommUtil.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,10 @@ bool CommUtil::writeBytes(uint8_t address, uint8_t subAddress, uint8_t *data, ui
6767
Serial.printf("result:%s\n", function_result ? "OK" : "NG");
6868
#endif
6969

70-
return (Wire.endTransmission() == 0); // Send the Tx buffer
70+
return function_result; // Send the Tx buffer
7171
}
7272

7373
bool CommUtil::readByte(uint8_t address, uint8_t *result) {
74-
uint8_t data; // `data` will store the register data
75-
7674
#ifdef I2C_DEBUG_TO_SERIAL
7775
Serial.printf("readByte :read from 0x%02x requestByte=1 receive=", address);
7876
#endif
@@ -91,8 +89,6 @@ bool CommUtil::readByte(uint8_t address, uint8_t *result) {
9189
}
9290

9391
bool CommUtil::readByte(uint8_t address, uint8_t subAddress,uint8_t *result) {
94-
uint8_t data; // `data` will store the register data
95-
9692
#ifdef I2C_DEBUG_TO_SERIAL
9793
Serial.printf("readByte :read from 0x%02x [0x%02x] requestByte=1 receive=", address, subAddress);
9894
#endif

src/utility/Power.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,6 @@ void POWER::begin() {
9999
}
100100
}
101101

102-
103-
static bool getI2CReg(uint8_t *result, uint8_t address, uint8_t *reg) {
104-
return (M5.I2C.readByte(address, *reg, result));
105-
}
106-
107-
static bool setI2CReg(uint8_t address, uint8_t reg, uint8_t value) {
108-
return (M5.I2C.writeByte(address, reg, value));
109-
}
110-
111102
bool POWER::setPowerBoostOnOff(bool en) {
112103
uint8_t data;
113104
if (M5.I2C.readByte(IP5306_ADDR, IP5306_REG_SYS_CTL1, &data) == true) {
@@ -229,6 +220,7 @@ bool POWER::setVinMaxCurrent(uint8_t cur) {
229220
if(M5.I2C.readByte(IP5306_ADDR, IP5306_REG_CHG_DIG, &data) == true) {
230221
return M5.I2C.writeByte(IP5306_ADDR, IP5306_REG_CHG_DIG, (data & 0xe0) | cur);
231222
}
223+
return false;
232224
}
233225

234226
bool POWER::setChargeVolt(uint8_t volt) {
@@ -331,7 +323,6 @@ bool POWER::isResetbyPowerSW() {
331323
void POWER::deepSleep(uint64_t time_in_us){
332324

333325
// Keep power keep boost on
334-
setLowPowerShutdown(false);
335326
setPowerBoostKeepOn(true);
336327

337328
// power off the Lcd

src/utility/qrcode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ int8_t qrcode_initText(QRCode *qrcode, uint8_t *modules, uint8_t version, uint8_
850850
}
851851

852852
bool qrcode_getModule(QRCode *qrcode, uint8_t x, uint8_t y) {
853-
if (x < 0 || x >= qrcode->size || y < 0 || y >= qrcode->size) {
853+
if (x >= qrcode->size || y >= qrcode->size) {
854854
return false;
855855
}
856856
uint32_t offset = y * qrcode->size + x;

src/utility/quaternionFilters.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
static float GyroMeasError = PI * (40.0f / 180.0f);
2020
// gyroscope measurement drift in rad/s/s (start at 0.0 deg/s/s)
21-
static float GyroMeasDrift = PI * (0.0f / 180.0f);
21+
// static float GyroMeasDrift = PI * (0.0f / 180.0f);
2222
// There is a tradeoff in the beta parameter between accuracy and response
2323
// speed. In the original Madgwick study, beta of 0.041 (corresponding to
2424
// GyroMeasError of 2.7 degrees/s) was found to give optimal accuracy.
@@ -35,7 +35,7 @@ static float GyroMeasDrift = PI * (0.0f / 180.0f);
3535
static float beta = sqrt(3.0f / 4.0f) * GyroMeasError; // Compute beta
3636
// Compute zeta, the other free parameter in the Madgwick scheme usually
3737
// set to a small or zero value
38-
static float zeta = sqrt(3.0f / 4.0f) * GyroMeasDrift;
38+
// static float zeta = sqrt(3.0f / 4.0f) * GyroMeasDrift;
3939

4040
// Vector to hold integral error for Mahony method
4141
static float eInt[3] = { 0.0f, 0.0f, 0.0f };

0 commit comments

Comments
 (0)