mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-28 13:16:32 +00:00
Merge pull request #12546 from s-hadinger/Ping-esp32c3
Fix compilaion for Esp32c3
This commit is contained in:
commit
164d0cb083
@ -125,7 +125,7 @@ extern "C" {
|
|||||||
struct pbuf *p;
|
struct pbuf *p;
|
||||||
uint16_t ping_size = sizeof(struct icmp_echo_hdr) + Ping_data_size;
|
uint16_t ping_size = sizeof(struct icmp_echo_hdr) + Ping_data_size;
|
||||||
|
|
||||||
ping->ping_time_sent = system_get_time();
|
ping->ping_time_sent = micros();
|
||||||
p = pbuf_alloc(PBUF_IP, ping_size, PBUF_RAM);
|
p = pbuf_alloc(PBUF_IP, ping_size, PBUF_RAM);
|
||||||
if (!p) { return; }
|
if (!p) { return; }
|
||||||
if ((p->len == p->tot_len) && (p->next == nullptr)) {
|
if ((p->len == p->tot_len) && (p->next == nullptr)) {
|
||||||
@ -191,7 +191,7 @@ extern "C" {
|
|||||||
if (iecho->seqno != ping->seqno){ // debounce already received packet
|
if (iecho->seqno != ping->seqno){ // debounce already received packet
|
||||||
/* do some ping result processing */
|
/* do some ping result processing */
|
||||||
sys_untimeout(t_ping_timeout, ping); // remove time-out handler
|
sys_untimeout(t_ping_timeout, ping); // remove time-out handler
|
||||||
uint32_t delay = system_relative_time(ping->ping_time_sent);
|
uint32_t delay = micros() - ping->ping_time_sent;
|
||||||
delay /= 1000;
|
delay /= 1000;
|
||||||
|
|
||||||
ping->sum_time += delay;
|
ping->sum_time += delay;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user