mirror of
https://github.com/esphome/esphome.git
synced 2024-11-26 17:05:21 +01:00
Clear UART read buffer before sending next command (#6200)
This commit is contained in:
parent
841a831c63
commit
4eb04afa62
1 changed files with 2 additions and 0 deletions
|
@ -336,6 +336,8 @@ void FingerprintGrowComponent::aura_led_control(uint8_t state, uint8_t speed, ui
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t FingerprintGrowComponent::send_command_() {
|
uint8_t FingerprintGrowComponent::send_command_() {
|
||||||
|
while (this->available())
|
||||||
|
this->read();
|
||||||
this->write((uint8_t) (START_CODE >> 8));
|
this->write((uint8_t) (START_CODE >> 8));
|
||||||
this->write((uint8_t) (START_CODE & 0xFF));
|
this->write((uint8_t) (START_CODE & 0xFF));
|
||||||
this->write(this->address_[0]);
|
this->write(this->address_[0]);
|
||||||
|
|
Loading…
Reference in a new issue