mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2025-06-29 18:45:23 +02:00
Sniffer timeout 100msec
This commit is contained in:
parent
8fcc2b0083
commit
08b8e43cd0
@ -103,9 +103,10 @@ Sniffer::Sniffer(byte snifferpin) {
|
|||||||
ESP_ERROR_CHECK(mcpwm_capture_enable_channel(MCPWM_UNIT_0, MCPWM_SELECT_CAP0, &MCPWM_cap_config));
|
ESP_ERROR_CHECK(mcpwm_capture_enable_channel(MCPWM_UNIT_0, MCPWM_SELECT_CAP0, &MCPWM_cap_config));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define SNIFFER_TIMEOUT 100L // 100 Milliseconds
|
||||||
bool Sniffer::inputActive(){
|
bool Sniffer::inputActive(){
|
||||||
unsigned long now = millis();
|
unsigned long now = millis();
|
||||||
return ((now - lastendofpacket) < 1000);
|
return ((now - lastendofpacket) < SNIFFER_TIMEOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define DCC_TOO_SHORT 4000L // 4000 ticks are 50usec
|
#define DCC_TOO_SHORT 4000L // 4000 ticks are 50usec
|
||||||
|
Loading…
x
Reference in New Issue
Block a user