Skip to content

Commit

Permalink
Fix compilation for cmake / pure C++
Browse files Browse the repository at this point in the history
  • Loading branch information
davetcc committed Oct 12, 2024
1 parent f268ae0 commit 76178be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/EepromAbstractionWire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ uint8_t I2cAt24Eeprom::findMaximumInPage(uint16_t destEeprom, uint8_t len) const
// We can read/write in bulk, but do no exceed the page size or we will read / write
// the wrong bytes
uint16_t offs = destEeprom % pageSize;
uint16_t currentGo = min((uint16_t)pageSize, uint16_t(offs + len)) - offs;
uint16_t currentGo = internal_min((uint16_t)pageSize, uint16_t(offs + len)) - offs;

// dont exceed the buffer length of the wire library
auto absoluteMax = MAX_BUFFER_SIZE_TO_USE - 2;
return min(currentGo, (uint16_t) absoluteMax);
return internal_min(currentGo, (uint16_t) absoluteMax);
}

uint8_t I2cAt24Eeprom::read8(EepromPosition position) {
Expand Down
4 changes: 2 additions & 2 deletions src/SwitchInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void KeyboardItem::checkAndTrigger(uint8_t buttonState){
else if (getState() == BUTTON_HELD && repeatInterval != NO_REPEAT && notify.callback != nullptr) {
counter = counter + (acceleration >> SWITCHES_ACCELERATION_DIVISOR) + 1;
if (counter > repeatInterval) {
acceleration = min(255, acceleration + 1);
acceleration = internal_min(255, acceleration + 1);
trigger(true);
counter = 0;
}
Expand Down Expand Up @@ -326,7 +326,7 @@ void RotaryEncoder::increment(int8_t incVal) {
currentReading = (currentReading + incVal);
if (currentReading > maximumValue) currentReading = currentReading - maximumValue - 1;
} else {
currentReading = min((uint16_t)(currentReading + incVal), maximumValue);
currentReading = internal_min((uint16_t)(currentReading + incVal), maximumValue);
}
} else if(currentReading < abs(incVal)) {
currentReading = rollover? maximumValue - safeAbs(incVal) + 1 : 0;
Expand Down

0 comments on commit 76178be

Please sign in to comment.