Skip to content

Commit 3a1ccdb

Browse files
authored
Merge pull request #206 from nscooling/Hrs3300_SetGain_remove_warnings
Eliminated warnings in Hrs3300
2 parents 97a1c4b + 0ad10a3 commit 3a1ccdb

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/drivers/Hrs3300.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,14 @@ uint16_t Hrs3300::ReadAls() {
7070
}
7171

7272
void Hrs3300::SetGain(uint8_t gain) {
73-
static constexpr uint8_t maxGain = 64;
73+
constexpr uint8_t maxGain = 64U;
7474
gain = std::min(gain, maxGain);
7575
uint8_t hgain = 0;
76-
while((1 << hgain) < gain) {
77-
hgain++;
78-
WriteRegister(static_cast<uint8_t>(Registers::Hgain), hgain << 2);
76+
while((1 << hgain) < gain){
77+
++hgain;
7978
}
79+
80+
WriteRegister(static_cast<uint8_t>(Registers::Hgain), hgain << 2);
8081
}
8182

8283
void Hrs3300::SetDrive(uint8_t drive) {

0 commit comments

Comments
 (0)