Flags for MarlinSerial instance features (#21318)

This commit is contained in:
X-Ryl669
2021-03-30 04:36:01 +02:00
committed by GitHub
parent 3f7cd45df4
commit 139c149486
8 changed files with 127 additions and 37 deletions

View File

@ -142,6 +142,8 @@ struct MeatpackSerial : public SerialBase <MeatpackSerial < SerialT >> {
// Existing instances implement Arduino's operator bool, so use that if it's available
bool connected() { return Private::HasMember_connected<SerialT>::value ? CALL_IF_EXISTS(bool, &out, connected) : (bool)out; }
void flushTX() { CALL_IF_EXISTS(void, &out, flushTX); }
SerialFeature features(serial_index_t index) const { return SerialFeature::MeatPack | CALL_IF_EXISTS(SerialFeature, &out, features, index); }
int available(serial_index_t index) {
if (charCount) return charCount; // The buffer still has data