Skip to content

Commit

Permalink
Fixes compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
GOB52 committed Sep 13, 2024
1 parent 2547be6 commit d42e305
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ m5::unit::UnitUnified Units;
m5::unit::UnitAmeter unit;

Sampling rate{Sampling::Rate32};
constexpr uint16_t sps_table[] = {8, 16, 32, 64, 128, 250, 475, 860};

} // namespace

Expand Down Expand Up @@ -61,7 +60,7 @@ void setup() {
#else
#pragma message "Using Wire"
// Using TwoWire
Wire.begin(pin_num_sda, pin_num_scl, 100000U);
Wire.begin(pin_num_sda, pin_num_scl, 400000U);
if (!Units.add(unit, Wire) || !Units.begin()) {
M5_LOGE("Failed to begin");
lcd.clear(TFT_RED);
Expand Down Expand Up @@ -92,8 +91,8 @@ void loop() {

if (M5.BtnA.wasClicked()) {
rate = static_cast<Sampling>((m5::stl::to_underlying(rate) + 1) & 0x07);
if (!unit.setSamplingRate(rate)) {
M5_LOGE("Failed to setSamplingRate");
if (!unit.writeSamplingRate(rate)) {
M5_LOGE("Failed to writeSamplingRate");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ m5::unit::UnitUnified Units;
m5::unit::UnitVmeter unit;

Sampling rate{Sampling::Rate32};
constexpr uint16_t sps_table[] = {8, 16, 32, 64, 128, 250, 475, 860};

} // namespace

Expand Down Expand Up @@ -61,7 +60,7 @@ void setup() {
#else
#pragma message "Using Wire"
// Using TwoWire
Wire.begin(pin_num_sda, pin_num_scl, 100000U);
Wire.begin(pin_num_sda, pin_num_scl, 400000U);
if (!Units.add(unit, Wire) || !Units.begin()) {
M5_LOGE("Failed to begin");
lcd.clear(TFT_RED);
Expand Down Expand Up @@ -92,8 +91,8 @@ void loop() {

if (M5.BtnA.wasClicked()) {
rate = static_cast<Sampling>((m5::stl::to_underlying(rate) + 1) & 0x07);
if (!unit.setSamplingRate(rate)) {
M5_LOGE("Failed to setSamplingRate");
if (!unit.writeSamplingRate(rate)) {
M5_LOGE("Failed to writeSamplingRate");
}
}
}

0 comments on commit d42e305

Please sign in to comment.