spam protection
This commit is contained in:
parent
3f7ea70f75
commit
0cd62f9db7
1 changed files with 3 additions and 0 deletions
|
@ -88,6 +88,9 @@ void _rc_serial_add(const char* data, size_t len) {
|
|||
}
|
||||
|
||||
void _handle_serial_send() {
|
||||
static unsigned long lastRC = 0;
|
||||
if (millis() - lastRC < 20) return;
|
||||
lastRC = millis();
|
||||
mutex_enter_blocking(&serial_mut);
|
||||
if (rcSerial.command == 0) {
|
||||
while (rcSerial.command < 30 && !queue_is_empty(&serial_write_queue)) {
|
||||
|
|
Loading…
Reference in a new issue