From c3ffa42557c9e27a27ca94bdf5399c0e3b3abec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wiesner=20Andr=C3=A1s?= Date: Sun, 16 Apr 2023 22:53:48 +0200 Subject: [PATCH] flexPTP updated --- Inc/lwipopts.h | 3 -- Src/flexptp | 2 +- Src/main.c | 19 ---------- fPTP_H743 Debug.launch | 79 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 80 insertions(+), 23 deletions(-) create mode 100644 fPTP_H743 Debug.launch diff --git a/Inc/lwipopts.h b/Inc/lwipopts.h index 6ee8b18..e848d48 100644 --- a/Inc/lwipopts.h +++ b/Inc/lwipopts.h @@ -86,9 +86,6 @@ a lot of data that needs to be copied, this should be set high. */ no copy is needed */ #define LWIP_SUPPORT_CUSTOM_PBUF 1 -/* --------- Ethernet hooks --------- */ -#define LWIP_HOOK_UNKNOWN_ETH_PROTOCOL(pbuf,netif) hook_unknown_ethertype(pbuf,netif) - /* ---------- IPv4 options ---------- */ #define LWIP_IPV4 1 diff --git a/Src/flexptp b/Src/flexptp index ac63947..cc86923 160000 --- a/Src/flexptp +++ b/Src/flexptp @@ -1 +1 @@ -Subproject commit ac63947fe1eb65a8f7de4dfb957952516b37b901 +Subproject commit cc86923abd3557c3cea8bb525c89401d0adda4d4 diff --git a/Src/main.c b/Src/main.c index 24e2ab3..93f4507 100644 --- a/Src/main.c +++ b/Src/main.c @@ -552,25 +552,6 @@ static void CPU_CACHE_Enable(void) { //SCB_EnableDCache(); } -#define ETHERNET_HEADER_LENGTH (14) - -err_t hook_unknown_ethertype(struct pbuf *pbuf, struct netif *netif) { - // aquire ethertype - uint16_t etherType = 0; - memcpy(ðerType, ((uint8_t*) pbuf->payload) + 12, 2); - etherType = ntohs(etherType); - if (etherType == ETHERTYPE_PTP) { - // verify Ethernet address - if (!memcmp(PTP_ETHERNET_PRIMARY, pbuf->payload, 6) || !memcmp(PTP_ETHERNET_PEER_DELAY, pbuf->payload, 6)) { // - ptp_enqueue_msg(((uint8_t*) pbuf->payload) + ETHERNET_HEADER_LENGTH, pbuf->len - ETHERNET_HEADER_LENGTH, pbuf->time_s, pbuf->time_ns, PTP_TP_802_3); - pbuf_free(pbuf); - return ERR_OK; - } - } - - return 1; -} - #ifdef USE_FULL_ASSERT /** diff --git a/fPTP_H743 Debug.launch b/fPTP_H743 Debug.launch new file mode 100644 index 0000000..4aa15e9 --- /dev/null +++ b/fPTP_H743 Debug.launch @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +