Skip to content

Commit

Permalink
Sync with local development
Browse files Browse the repository at this point in the history
  • Loading branch information
vanvught committed Nov 20, 2023
1 parent f7b53c6 commit 15013aa
Show file tree
Hide file tree
Showing 18 changed files with 213 additions and 137 deletions.
2 changes: 2 additions & 0 deletions firmware-template-gd32/Includes.mk
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
$(info "Includes.mk")

INCLUDES:=-I./include -I../include -I../lib-hal/include -I../lib-debug/include
INCLUDES+=$(addprefix -I,$(EXTRA_INCLUDES))
INCLUDES+=-I../firmware-template-gd32/include
Expand Down
2 changes: 2 additions & 0 deletions firmware-template-gd32/Mcu.mk
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
$(info "Mcu.mk")

ifndef MCU
$(error MCU is not set)
endif
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
// Generated do 14 sep 2023 12:39:29 CEST
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1694687969;
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1700506419;
3 changes: 1 addition & 2 deletions gd32_emac_artnet_pixel_multi/include/sofware_version_id.h
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
// Generated do 14 sep 2023 12:39:29 CEST
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1694687969;
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1700506448;
3 changes: 1 addition & 2 deletions gd32_emac_ddp_pixel_dmx_multi/include/sofware_version_id.h
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
// Generated do 14 sep 2023 12:39:32 CEST
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1694687972;
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1700506457;
3 changes: 1 addition & 2 deletions gd32_emac_ddp_pixel_multi/include/sofware_version_id.h
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
// Generated do 14 sep 2023 12:39:34 CEST
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1694687974;
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1700506466;
3 changes: 1 addition & 2 deletions gd32_emac_e131_pixel_dmx_multi/include/sofware_version_id.h
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
// Generated do 14 sep 2023 12:39:45 CEST
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1694687985;
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1700506475;
3 changes: 1 addition & 2 deletions gd32_emac_e131_pixel_multi/include/sofware_version_id.h
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
// Generated do 14 sep 2023 12:39:46 CEST
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1694687986;
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1700506484;
2 changes: 1 addition & 1 deletion lib-artnet/src/node/artnetparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ void ArtNetParams::Builder(const struct Params *pParams, char *pBuffer, uint32_t
PropertiesBuilder builder(ArtNetParamsConst::FILE_NAME, pBuffer, nLength);

if (!isMaskSet(Mask::LONG_NAME)) {
memcpy(m_Params.aLongName, ArtNetNode::Get()->GetLongName(), artnet::LONG_NAME_LENGTH);
ArtNetNode::Get()->GetLongNameDefault(reinterpret_cast<char *>(m_Params.aLongName));
}
builder.Add(LightSetParamsConst::NODE_LONG_NAME, reinterpret_cast<const char*>(m_Params.aLongName), isMaskSet(Mask::LONG_NAME));

Expand Down
37 changes: 22 additions & 15 deletions lib-configstore/Rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ ifneq ($(MAKE_FLAGS),)
EXTRA_INCLUDES+=../lib-artnet/include
EXTRA_SRCDIR+=src/rdm
RDM=1
EXTRA_INCLUDES+=../lib-rdm/include ../lib-rdmsensor/include ../lib-rdmsubdevice/include
ifeq ($(findstring ARTNET_VERSION=4,$(MAKE_FLAGS)), ARTNET_VERSION=4)
EXTRA_INCLUDES+=../lib-e131/include
endif
Expand All @@ -73,6 +72,7 @@ ifneq ($(MAKE_FLAGS),)
EXTRA_INCLUDES+=../lib-node/include
EXTRA_INCLUDES+=../lib-artnet/include ../lib-rdmdiscovery/include
EXTRA_INCLUDES+=../lib-e131/include
RDM=1
endif

ifeq ($(findstring NODE_OSC_CLIENT,$(MAKE_FLAGS)), NODE_OSC_CLIENT)
Expand Down Expand Up @@ -148,24 +148,34 @@ ifneq ($(MAKE_FLAGS),)
EXTRA_SRCDIR+=src/rdm
RDM=1
endif
EXTRA_INCLUDES+=../lib-rdm/include ../lib-rdmsensor/include ../lib-rdmsubdevice/include
endif

ifeq ($(findstring WIDGET_HAVE_FLASHROM,$(MAKE_FLAGS)), WIDGET_HAVE_FLASHROM)
EXTRA_SRCDIR+=src/widget
EXTRA_INCLUDES+=../lib-widget/include
endif

ifdef RDM
EXTRA_INCLUDES+=../lib-rdm/include ../lib-rdmsensor/include ../lib-rdmsubdevice/include
endif
else
EXTRA_SRCDIR+=src/artnet
EXTRA_INCLUDES+=../lib-artnet/include
EXTRA_SRCDIR+=src/e131
EXTRA_INCLUDES+=../lib-e131/include
EXTRA_SRCDIR+=src/node
EXTRA_INCLUDES+=../lib-node/include ../lib-rdmdiscovery/include
EXTRA_SRCDIR+=src/ltc
EXTRA_INCLUDES+=../lib-ltc/include ../lib-tcnet/include
EXTRA_INCLUDES+=../lib-gps/include
EXTRA_INCLUDES+=../lib-rgbpanel/include
ifneq (, $(shell test -d '../lib-network/src/noemac' && echo -n yes))
DEFINES+=NO_EMAC
else
DEFINES+=ARTNET_VERSION=4
EXTRA_INCLUDES+=../lib-remoteconfig/include
EXTRA_SRCDIR+=src/artnet
EXTRA_INCLUDES+=../lib-artnet/include
EXTRA_SRCDIR+=src/e131
EXTRA_INCLUDES+=../lib-e131/include
EXTRA_SRCDIR+=src/node
EXTRA_INCLUDES+=../lib-node/include ../lib-rdmdiscovery/include
EXTRA_SRCDIR+=src/ltc
EXTRA_INCLUDES+=../lib-ltc/include ../lib-tcnet/include
EXTRA_INCLUDES+=../lib-gps/include
EXTRA_INCLUDES+=../lib-rgbpanel/include
endif

EXTRA_INCLUDES+=../lib-ws28xx/include
EXTRA_SRCDIR+=src/rdm
EXTRA_INCLUDES+=../lib-rdm/include ../lib-rdmsensor/include ../lib-rdmsubdevice/include
Expand All @@ -175,7 +185,6 @@ else
EXTRA_SRCDIR+=src/pca9685
EXTRA_INCLUDES+=../lib-pca9685dmx/include ../lib-pca9685/include

DEFINES+=ARTNET_VERSION=4
DEFINES+=LIGHTSET_PORTS=4
DEFINES+=CONFIG_PIXELDMX_MAX_PORTS=8
DEFINES+=CONFIG_DDPDISPLAY_MAX_PORTS=8
Expand All @@ -186,7 +195,5 @@ EXTRA_INCLUDES+=../lib-dmxsend/include
EXTRA_INCLUDES+=../lib-dmxmonitor/include
EXTRA_INCLUDES+=../lib-dmxreceiver/include ../lib-dmx/include
EXTRA_INCLUDES+=../lib-oscserver/include
EXTRA_INCLUDES+=../lib-rdm/include ../lib-rdmsensor/include ../lib-rdmsubdevice/include
EXTRA_INCLUDES+=../lib-spiflashinstall/include
EXTRA_INCLUDES+=../lib-device/include
EXTRA_INCLUDES+=../lib-midi/include
19 changes: 12 additions & 7 deletions lib-displayudf/Rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,20 @@ ifneq ($(MAKE_FLAGS),)
endif
endif
else
DEFINES+=NODE_ARTNET NODE_E131 OUTPUT_DMX_ARTNET RDM_RESPONDER
ifneq (, $(shell test -d '../lib-network/src/noemac' && echo -n yes))
DEFINES+=NO_EMAC
else
DEFINES+=NODE_ARTNET NODE_E131 OUTPUT_DMX_ARTNET
DEFINES+=ARTNET_VERSION=4
EXTRA_SRCDIR+=src/artnet src/e131 src/network
EXTRA_INCLUDES+=../lib-artnet/include ../lib-e131/include ../lib-network/include
EXTRA_INCLUDES+=../lib-node/include
endif

DEFINES+=RDM_RESPONDER
DEFINES+=LIGHTSET_PORTS=4
DEFINES+=ARTNET_VERSION=4

EXTRA_INCLUDES+=../lib-node/include
EXTRA_INCLUDES+=../lib-artnet/include ../lib-e131/include ../lib-network/include
EXTRA_INCLUDES+=../lib-dmxreceiver/include ../lib-dmx/include
EXTRA_INCLUDES+=../lib-rdmdiscovery/include
EXTRA_INCLUDES+=../lib-rdmresponder/include ../lib-rdm/include ../lib-rdmsensor/include ../lib-rdmsubdevice/include

EXTRA_SRCDIR+=src/artnet src/e131 src/network
EXTRA_INCLUDES+=../lib-rdm/include ../lib-rdmsensor/include ../lib-rdmsubdevice/include
endif
154 changes: 85 additions & 69 deletions lib-gd32/Makefile.GD32
Original file line number Diff line number Diff line change
@@ -1,76 +1,68 @@
$(info $$FAMILY [${FAMILY}])
$(info $$MAKE_FLAGS [${MAKE_FLAGS}])

ifeq ($(FAMILY),)
FAMILY=gd32f20x
endif

$(info $$FAMILY [${FAMILY}])

ifeq ($(findstring gd32f10x,$(FAMILY)), gd32f10x)
EXTRA_SRCDIR=gd32f10x/CMSIS/GD/GD32F10x/Source
EXTRA_SRCDIR+=gd32f10x/GD32F10x_standard_peripheral/Source
endif

ifeq ($(findstring gd32f20x,$(FAMILY)), gd32f20x)
EXTRA_SRCDIR=gd32f20x/CMSIS/GD/GD32F20x/Source
EXTRA_SRCDIR+=gd32f20x/GD32F20x_standard_peripheral/Source
ifeq ($(findstring ENABLE_USB_HOST,$(MAKE_FLAGS)), ENABLE_USB_HOST)
EXTRA_SRCDIR+=gd32f20x/GD32F20x_usbfs_library/host/core/Source

EXTRA_C_SOURCE_FILES=gd32f20x/GD32F20x_usbfs_library/driver/Source/drv_usb_core.c
EXTRA_C_SOURCE_FILES+=gd32f20x/GD32F20x_usbfs_library/driver/Source/drv_usb_host.c
EXTRA_C_SOURCE_FILES+=gd32f20x/GD32F20x_usbfs_library/driver/Source/drv_usbh_int.c

EXTRA_INCLUDES+=gd32f20x/GD32F20x_usbfs_library/driver/Include
EXTRA_INCLUDES+=gd32f20x/GD32F20x_usbfs_library/host/core/Include
EXTRA_INCLUDES+=gd32f20x/GD32F20x_usbfs_library/ustd/common

ifeq ($(findstring CONFIG_USB_HOST_MSC,$(MAKE_FLAGS)), CONFIG_USB_HOST_MSC)
EXTRA_SRCDIR+=gd32f20x/GD32F20x_usbfs_library/host/class/msc/Source

EXTRA_INCLUDES+=gd32f20x/GD32F20x_usbfs_library/host/class/msc/Include
EXTRA_INCLUDES+=gd32f20x/GD32F20x_usbfs_library/ustd/class/msc

EXTRA_INCLUDES+=../lib-hal/ff12c
endif

endif
endif

ifeq ($(findstring gd32f30x,$(FAMILY)), gd32f30x)
EXTRA_SRCDIR=gd32f30x/CMSIS/GD/GD32F30x/Source
EXTRA_SRCDIR+=gd32f30x/GD32F30x_standard_peripheral/Source
endif
ifneq ($(MAKE_FLAGS),)
ifeq ($(findstring gd32f10x,$(FAMILY)), gd32f10x)
EXTRA_SRCDIR=gd32f10x/CMSIS/GD/GD32F10x/Source
EXTRA_SRCDIR+=gd32f10x/GD32F10x_standard_peripheral/Source
endif

ifeq ($(findstring gd32f4xx,$(FAMILY)), gd32f4xx)
EXTRA_SRCDIR=gd32f4xx/CMSIS/GD/GD32F4xx/Source
EXTRA_SRCDIR+=gd32f4xx/GD32F4xx_standard_peripheral/Source
ifeq ($(findstring ENABLE_USB_HOST,$(MAKE_FLAGS)), ENABLE_USB_HOST)
EXTRA_SRCDIR+=gd32f4xx/GD32F4xx_usb_library/host/core/Source

EXTRA_C_SOURCE_FILES=gd32f4xx/GD32F4xx_usb_library/driver/Source/drv_usb_core.c
EXTRA_C_SOURCE_FILES+=gd32f4xx/GD32F4xx_usb_library/driver/Source/drv_usb_host.c
EXTRA_C_SOURCE_FILES+=gd32f4xx/GD32F4xx_usb_library/driver/Source/drv_usbh_int.c

EXTRA_INCLUDES+=gd32f4xx/GD32F4xx_usb_library/driver/Include
EXTRA_INCLUDES+=gd32f4xx/GD32F4xx_usb_library/host/core/Include
EXTRA_INCLUDES+=gd32f4xx/GD32F4xx_usb_library/ustd/common

ifeq ($(findstring CONFIG_USB_HOST_MSC,$(MAKE_FLAGS)), CONFIG_USB_HOST_MSC)
EXTRA_SRCDIR+=gd32f4xx/GD32F4xx_usb_library/host/class/msc/Source

EXTRA_INCLUDES+=gd32f4xx/GD32F4xx_usb_library/host/class/msc/Include
EXTRA_INCLUDES+=gd32f4xx/GD32F4xx_usb_library/ustd/class/msc

EXTRA_INCLUDES+=../lib-hal/ff12c
endif

endif
endif
ifeq ($(findstring gd32f20x,$(FAMILY)), gd32f20x)
EXTRA_SRCDIR=gd32f20x/CMSIS/GD/GD32F20x/Source
EXTRA_SRCDIR+=gd32f20x/GD32F20x_standard_peripheral/Source
ifeq ($(findstring ENABLE_USB_HOST,$(MAKE_FLAGS)), ENABLE_USB_HOST)
EXTRA_SRCDIR+=gd32f20x/GD32F20x_usbfs_library/host/core/Source

EXTRA_C_SOURCE_FILES=gd32f20x/GD32F20x_usbfs_library/driver/Source/drv_usb_core.c
EXTRA_C_SOURCE_FILES+=gd32f20x/GD32F20x_usbfs_library/driver/Source/drv_usb_host.c
EXTRA_C_SOURCE_FILES+=gd32f20x/GD32F20x_usbfs_library/driver/Source/drv_usbh_int.c

EXTRA_INCLUDES+=gd32f20x/GD32F20x_usbfs_library/driver/Include
EXTRA_INCLUDES+=gd32f20x/GD32F20x_usbfs_library/host/core/Include
EXTRA_INCLUDES+=gd32f20x/GD32F20x_usbfs_library/ustd/common

ifeq ($(findstring CONFIG_USB_HOST_MSC,$(MAKE_FLAGS)), CONFIG_USB_HOST_MSC)
EXTRA_SRCDIR+=gd32f20x/GD32F20x_usbfs_library/host/class/msc/Source

EXTRA_INCLUDES+=gd32f20x/GD32F20x_usbfs_library/host/class/msc/Include
EXTRA_INCLUDES+=gd32f20x/GD32F20x_usbfs_library/ustd/class/msc

EXTRA_INCLUDES+=../lib-hal/ff12c
endif
endif
endif

$(info $$MAKE_FLAGS [${MAKE_FLAGS}])
ifeq ($(findstring gd32f30x,$(FAMILY)), gd32f30x)
EXTRA_SRCDIR=gd32f30x/CMSIS/GD/GD32F30x/Source
EXTRA_SRCDIR+=gd32f30x/GD32F30x_standard_peripheral/Source
endif

ifeq ($(findstring gd32f4xx,$(FAMILY)), gd32f4xx)
EXTRA_SRCDIR=gd32f4xx/CMSIS/GD/GD32F4xx/Source
EXTRA_SRCDIR+=gd32f4xx/GD32F4xx_standard_peripheral/Source
ifeq ($(findstring ENABLE_USB_HOST,$(MAKE_FLAGS)), ENABLE_USB_HOST)
EXTRA_SRCDIR+=gd32f4xx/GD32F4xx_usb_library/host/core/Source

EXTRA_C_SOURCE_FILES=gd32f4xx/GD32F4xx_usb_library/driver/Source/drv_usb_core.c
EXTRA_C_SOURCE_FILES+=gd32f4xx/GD32F4xx_usb_library/driver/Source/drv_usb_host.c
EXTRA_C_SOURCE_FILES+=gd32f4xx/GD32F4xx_usb_library/driver/Source/drv_usbh_int.c

EXTRA_INCLUDES+=gd32f4xx/GD32F4xx_usb_library/driver/Include
EXTRA_INCLUDES+=gd32f4xx/GD32F4xx_usb_library/host/core/Include
EXTRA_INCLUDES+=gd32f4xx/GD32F4xx_usb_library/ustd/common

ifeq ($(findstring CONFIG_USB_HOST_MSC,$(MAKE_FLAGS)), CONFIG_USB_HOST_MSC)
EXTRA_SRCDIR+=gd32f4xx/GD32F4xx_usb_library/host/class/msc/Source

EXTRA_INCLUDES+=gd32f4xx/GD32F4xx_usb_library/host/class/msc/Include
EXTRA_INCLUDES+=gd32f4xx/GD32F4xx_usb_library/ustd/class/msc

EXTRA_INCLUDES+=../lib-hal/ff12c
endif

endif
endif

ifneq ($(MAKE_FLAGS),)
ifeq ($(findstring NO_EMAC,$(MAKE_FLAGS)), NO_EMAC)
else
EXTRA_SRCDIR+=device/emac
Expand All @@ -93,11 +85,35 @@ ifneq ($(MAKE_FLAGS),)
EXTRA_SRCDIR+=device/usb
endif
else
FAMILY=
ifeq ($(FAMILY),)
ifneq (, $(shell test -d '../lib-gd32/gd32f20x' && echo -n yes))
FAMILY=gd32f20x
HAVE_SOFTUART=1
else
ifneq (, $(shell test -d '../lib-gd32/gd32f10x' && echo -n yes))
FAMILY=gd32f10x
endif
ifneq (, $(shell test -d '../lib-gd32/gd32f30x' && echo -n yes))
FAMILY=gd32f30x
endif
ifneq (, $(shell test -d '../lib-gd32/gd32f4xx' && echo -n yes))
FAMILY=gd32f4xx
HAVE_SOFTUART=1
endif
endif
endif

EXTRA_SRCDIR+=device/emac device/emac/dsa
EXTRA_SRCDIR+=device/usb
EXTRA_SRCDIR+=src/uart0 src/softuart0
EXTRA_SRCDIR+=src/uart0
ifdef HAVE_SOFTUART
EXTRA_SRCDIR+=src/softuart0
endif

DEFINES=ENABLE_USB_HOST CONFIG_USB_HOST_MSC
endif

$(info $$FAMILY [${FAMILY}])

include ../firmware-template-gd32/lib/Rules.mk
11 changes: 7 additions & 4 deletions lib-hal/Makefile.GD32
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@ ifneq ($(MAKE_FLAGS),)
EXTRA_SRCDIR+=debug/emac/gd32
endif
else
EXTRA_SRCDIR+=debug/emac/gd32
ifneq (, $(shell test -d '../lib-network/src/noemac' && echo -n yes))
else
EXTRA_SRCDIR+=debug/emac/gd32
endif
EXTRA_SRCDIR+=rtc/gd32
EXTRA_SRCDIR+=device/usb/host/gd32
EXTRA_INCLUDES+=device/usb/host/gd32
# EXTRA_SRCDIR+=device/usb/host/gd32
# EXTRA_INCLUDES+=device/usb/host/gd32

DEFINES=ENABLE_USB_HOST CONFIG_USB_HOST_MSC
# DEFINES=ENABLE_USB_HOST CONFIG_USB_HOST_MSC
endif

include Rules.mk
Expand Down
2 changes: 0 additions & 2 deletions lib-network/src/net/icmp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

namespace net {
namespace globals {
extern struct IpInfo ipInfo;
extern uint8_t macAddress[ETH_ADDR_LEN];
} // namespace globals
} // namespace net
Expand All @@ -49,7 +48,6 @@ __attribute__((hot)) void icmp_handle(struct t_icmp *p_icmp) {
// Ethernet
memcpy(p_icmp->ether.dst, p_icmp->ether.src, ETH_ADDR_LEN);
memcpy(p_icmp->ether.src, net::globals::macAddress, ETH_ADDR_LEN);

// IPv4
p_icmp->ip4.id = static_cast<uint16_t>(~p_icmp->ip4.id);
uint8_t dst[IPv4_ADDR_LEN];
Expand Down
Loading

0 comments on commit 15013aa

Please sign in to comment.