diff options
| author | JF <jf@codingfield.com> | 2021-02-14 15:37:28 (GMT) |
|---|---|---|
| committer | Gitea <gitea@fake.local> | 2021-02-14 15:37:28 (GMT) |
| commit | 9d7955b6c0128a72475742495dabb57134dbe56d (patch) | |
| tree | 27bdf0ae697453f31e0fa6952d3bf0ecbea48c68 /src/drivers | |
| parent | f534fb0356762122842ea49b481619cb963a5d27 (diff) | |
| parent | 324c7dab326ea23a6c8502bbb8c6e9b9d87a839f (diff) | |
Merge branch 'develop' of JF/PineTime into master
Diffstat (limited to 'src/drivers')
| -rw-r--r-- | src/drivers/Hrs3300.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/drivers/Hrs3300.cpp b/src/drivers/Hrs3300.cpp index 2aded7d..dc9f9cd 100644 --- a/src/drivers/Hrs3300.cpp +++ b/src/drivers/Hrs3300.cpp @@ -70,13 +70,14 @@ uint16_t Hrs3300::ReadAls() { } void Hrs3300::SetGain(uint8_t gain) { - static constexpr uint8_t maxGain = 64; + constexpr uint8_t maxGain = 64U; gain = std::min(gain, maxGain); uint8_t hgain = 0; - while((1 << hgain) < gain) - hgain++; + while((1 << hgain) < gain){ + ++hgain; + } - WriteRegister(static_cast<uint8_t>(Registers::Hgain), hgain << 2); + WriteRegister(static_cast<uint8_t>(Registers::Hgain), hgain << 2); } void Hrs3300::SetDrive(uint8_t drive) { |
