Skip to content

Commit 76178be

Browse files
committed
Fix compilation for cmake / pure C++
1 parent f268ae0 commit 76178be

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/EepromAbstractionWire.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ uint8_t I2cAt24Eeprom::findMaximumInPage(uint16_t destEeprom, uint8_t len) const
6767
// We can read/write in bulk, but do no exceed the page size or we will read / write
6868
// the wrong bytes
6969
uint16_t offs = destEeprom % pageSize;
70-
uint16_t currentGo = min((uint16_t)pageSize, uint16_t(offs + len)) - offs;
70+
uint16_t currentGo = internal_min((uint16_t)pageSize, uint16_t(offs + len)) - offs;
7171

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

7777
uint8_t I2cAt24Eeprom::read8(EepromPosition position) {

src/SwitchInput.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ void KeyboardItem::checkAndTrigger(uint8_t buttonState){
100100
else if (getState() == BUTTON_HELD && repeatInterval != NO_REPEAT && notify.callback != nullptr) {
101101
counter = counter + (acceleration >> SWITCHES_ACCELERATION_DIVISOR) + 1;
102102
if (counter > repeatInterval) {
103-
acceleration = min(255, acceleration + 1);
103+
acceleration = internal_min(255, acceleration + 1);
104104
trigger(true);
105105
counter = 0;
106106
}
@@ -326,7 +326,7 @@ void RotaryEncoder::increment(int8_t incVal) {
326326
currentReading = (currentReading + incVal);
327327
if (currentReading > maximumValue) currentReading = currentReading - maximumValue - 1;
328328
} else {
329-
currentReading = min((uint16_t)(currentReading + incVal), maximumValue);
329+
currentReading = internal_min((uint16_t)(currentReading + incVal), maximumValue);
330330
}
331331
} else if(currentReading < abs(incVal)) {
332332
currentReading = rollover? maximumValue - safeAbs(incVal) + 1 : 0;

0 commit comments

Comments
 (0)