- upgraded to GCC14

This commit is contained in:
Wiesner András 2025-06-21 09:44:53 +02:00
parent 4c3b477ad6
commit 0e88dd896e
3 changed files with 33 additions and 2 deletions

View File

@ -1,8 +1,6 @@
#ifndef FLEXPTP_OPTIONS_CH32F207_H_ #ifndef FLEXPTP_OPTIONS_CH32F207_H_
#define FLEXPTP_OPTIONS_CH32F207_H_ #define FLEXPTP_OPTIONS_CH32F207_H_
#define ETHLIB
// ------------------------------------------- // -------------------------------------------
// ------ DEFINES FOR FLEXPTP SETTINGS ------- // ------ DEFINES FOR FLEXPTP SETTINGS -------
// ------------------------------------------- // -------------------------------------------
@ -24,6 +22,7 @@
#include "cli.h" #include "cli.h"
#include "utils.h" #include "utils.h"
#include "embfmt/embformat.h"
#define FLEXPTP_SNPRINTF(...) embfmt(__VA_ARGS__) #define FLEXPTP_SNPRINTF(...) embfmt(__VA_ARGS__)
@ -41,6 +40,8 @@
#include "inc/hw_memmap.h" #include "inc/hw_memmap.h"
#include "driverlib/emac.h" #include "driverlib/emac.h"
#include "flexptp/port/example_ports/ptp_port_tiva_tm4c1294.h"
#define PTP_HW_INIT(increment, addend) ptphw_init(increment, addend) #define PTP_HW_INIT(increment, addend) ptphw_init(increment, addend)
#define PTP_UPDATE_CLOCK(s,ns) EMACTimestampSysTimeUpdate(EMAC0_BASE, labs(s), abs(ns), (s * NANO_PREFIX + ns) < 0) #define PTP_UPDATE_CLOCK(s,ns) EMACTimestampSysTimeUpdate(EMAC0_BASE, labs(s), abs(ns), (s * NANO_PREFIX + ns) < 0)
#define PTP_SET_CLOCK(s, ns) EMACTimestampSysTimeSet(EMAC0_BASE, s, ns) #define PTP_SET_CLOCK(s, ns) EMACTimestampSysTimeSet(EMAC0_BASE, s, ns)

View File

@ -35,6 +35,7 @@
#define __LWIPOPTS_H__ #define __LWIPOPTS_H__
#include <cmsis_os2.h> #include <cmsis_os2.h>
#include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
/** /**
@ -103,6 +104,9 @@ a lot of data that needs to be copied, this should be set high. */
/* --------- Ethernet hooks --------- */ /* --------- Ethernet hooks --------- */
struct netif;
struct pbuf;
extern int8_t hook_unknown_ethertype(struct pbuf *pbuf, struct netif *netif);
#define LWIP_HOOK_UNKNOWN_ETH_PROTOCOL(pbuf,netif) hook_unknown_ethertype(pbuf,netif) #define LWIP_HOOK_UNKNOWN_ETH_PROTOCOL(pbuf,netif) hook_unknown_ethertype(pbuf,netif)
/* ---------- IPv4 options ---------- */ /* ---------- IPv4 options ---------- */

View File

@ -41,6 +41,7 @@
/* lwIP includes. */ /* lwIP includes. */
#include "lwip/opt.h" #include "lwip/opt.h"
#include "lwip/sys.h" #include "lwip/sys.h"
#include "lwip/mem.h"
#if NO_SYS #if NO_SYS
@ -395,6 +396,31 @@ sys_mbox_trypost(sys_mbox_t *mbox, void *msg)
return ERR_MEM; return ERR_MEM;
} }
/**
* Tries to send a message to a mailbox.
*
* @param mbox is the mailbox
* @param msg is the message to send
* @return ERR_OK if the message was sent and ERR_MEM if there was no space for
* the message
*/
err_t
sys_mbox_trypost_fromisr(sys_mbox_t *mbox, void *msg)
{
/* Send this message to the queue. */
if(xQueueSendFromISR(mbox->queue, &msg, 0) == pdPASS) {
return ERR_OK;
}
/* Update the mailbox statistics. */
#if SYS_STATS
STATS_INC(sys.mbox.err);
#endif /* SYS_STATS */
/* The message could not be sent. */
return ERR_MEM;
}
/** /**
* Retrieve a message from a mailbox. * Retrieve a message from a mailbox.
* *