mirror of
https://github.com/okalachev/flix.git
synced 2026-09-05 16:00:56 +00:00
Add some missing emulated Arduino methods for future use
* String::toUpperCase() * Serial.read(*buf, len) * Serial.write()
This commit is contained in:
@@ -60,6 +60,10 @@ public:
|
||||
std::transform(this->begin(), this->end(), this->begin(),
|
||||
[](unsigned char c) { return std::tolower(c); });
|
||||
}
|
||||
void toUpperCase() {
|
||||
std::transform(this->begin(), this->end(), this->begin(),
|
||||
[](unsigned char c) { return std::toupper(c); });
|
||||
}
|
||||
};
|
||||
|
||||
class Print;
|
||||
@@ -149,6 +153,17 @@ public:
|
||||
return -1;
|
||||
}
|
||||
|
||||
int read(uint8_t *buf, int len) {
|
||||
if (available()) {
|
||||
return ::read(STDIN_FILENO, buf, len);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int write(const uint8_t *data, int len) {
|
||||
return ::write(STDOUT_FILENO, data, len);
|
||||
}
|
||||
|
||||
void setRxInvert(bool invert) {};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user