Clear UART read buffer before sending next command (#6200)

This commit is contained in:
SmartShackMaster 2024-02-20 23:27:17 +02:00 committed by GitHub
parent 2948d87a66
commit 1f432ec7de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -336,6 +336,8 @@ void FingerprintGrowComponent::aura_led_control(uint8_t state, uint8_t speed, ui
}
uint8_t FingerprintGrowComponent::send_command_() {
while (this->available())
this->read();
this->write((uint8_t) (START_CODE >> 8));
this->write((uint8_t) (START_CODE & 0xFF));
this->write(this->address_[0]);