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 Jan 22, 2024
1 parent 962454d commit a7226d5
Show file tree
Hide file tree
Showing 81 changed files with 129 additions and 10,363 deletions.
2 changes: 1 addition & 1 deletion firmware-template-gd32/Includes.mk
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ ifeq ($(findstring gd32f4xx,$(FAMILY)), gd32f4xx)
endif

ifdef USB_HOST_MSC
EXTRA_INCLUDES+=../lib-hal/ff12c
EXTRA_INCLUDES+=../lib-hal/ff14b/source
endif
23 changes: 9 additions & 14 deletions firmware-template/libs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,18 @@ ifeq ($(findstring NODE_DDP_DISPLAY,$(DEFINES)),NODE_DDP_DISPLAY)
LIBS+=ddp
endif

RDM=
DMX=

ifeq ($(findstring NODE_DMX,$(DEFINES)),NODE_DMX)
LIBS+=dmxreceiver
DMX=1
endif

ifeq ($(findstring NODE_RDMNET_LLRP_ONLY,$(DEFINES)),NODE_RDMNET_LLRP_ONLY)
ifneq ($(findstring rdmnet,$(LIBS)),rdmnet)
LIBS+=rdmnet
endif
RDM=1
ifneq ($(findstring e131,$(LIBS)),e131)
LIBS+=e131
endif
RDM=1
endif

ifdef RDM
LIBS+=rdm
endif

ifeq ($(findstring e131,$(LIBS)),e131)
LIBS+=uuid
endif

ifeq ($(findstring OUTPUT_DMX_MONITOR,$(DEFINES)),OUTPUT_DMX_MONITOR)
LIBS+=dmxmonitor
Expand All @@ -58,10 +45,18 @@ ifeq ($(findstring OUTPUT_DMX_SEND,$(DEFINES)),OUTPUT_DMX_SEND)
DMX=1
endif

ifdef RDM
LIBS+=rdm
endif

ifdef DMX
LIBS+=dmx
endif

ifeq ($(findstring e131,$(LIBS)),e131)
LIBS+=uuid
endif

ifeq ($(findstring OUTPUT_DDP_PIXEL_MULTI,$(DEFINES)),OUTPUT_DDP_PIXEL_MULTI)
LIBS+=ws28xxdmx ws28xx
else
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1704725179;
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1705926049;
2 changes: 1 addition & 1 deletion gd32_emac_artnet_pixel_multi/include/sofware_version_id.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1702811908;
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1705926074;
2 changes: 1 addition & 1 deletion gd32_emac_ddp_pixel_dmx_multi/include/sofware_version_id.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1702811913;
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1705926082;
2 changes: 1 addition & 1 deletion gd32_emac_ddp_pixel_multi/include/sofware_version_id.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1702811915;
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1705926090;
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=1705926103;
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=1705926111;
4 changes: 2 additions & 2 deletions include/dirent.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @file dirent.h
*
*/
/* Copyright (C) 2020 by Arjan van Vught mailto:info@orangepi-dmx.nl
/* Copyright (C) 2020-2024 by Arjan van Vught mailto:info@orangepi-dmx.nl
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -28,7 +28,7 @@

#include <stdio.h>

#if !defined (_FATFS)
#if !defined (FF_DEFINED)
typedef void *DIR;
#endif

Expand Down
24 changes: 24 additions & 0 deletions lib-c/src/memcmp.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (c) 2013-2019, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/

#include <stddef.h>

int memcmp(const void *s1, const void *s2, size_t len)
{
const unsigned char *s = s1;
const unsigned char *d = s2;
unsigned char sc;
unsigned char dc;

while (len--) {
sc = *s++;
dc = *d++;
if (sc - dc)
return (sc - dc);
}

return 0;
}
4 changes: 2 additions & 2 deletions lib-gd32/Makefile.GD32
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ifneq ($(MAKE_FLAGS),)
EXTRA_INCLUDES+=gd32f20x/GD32F20x_usbfs_library/host/class/msc/Include
EXTRA_INCLUDES+=gd32f20x/GD32F20x_usbfs_library/ustd/class/msc

EXTRA_INCLUDES+=../lib-hal/ff12c
EXTRA_INCLUDES+=../lib-hal/ff14b/source
endif
endif
endif
Expand Down Expand Up @@ -57,7 +57,7 @@ ifneq ($(MAKE_FLAGS),)
EXTRA_INCLUDES+=gd32f4xx/GD32F4xx_usb_library/host/class/msc/Include
EXTRA_INCLUDES+=gd32f4xx/GD32F4xx_usb_library/ustd/class/msc

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

endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ OF SUCH DAMAGE.
*/

#include "usb_conf.h"
#include "diskio.h"
#include "usbh_msc_core.h"

#include "ff.h"
#include "diskio.h"

static volatile DSTATUS state = STA_NOINIT; /* disk status */

extern usbh_host usb_host_msc;
Expand Down
43 changes: 28 additions & 15 deletions ...piflashstore/src/platform_spiflashstore.h → lib-gd32/include/mcu/gd32f470_mcu.h
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* @file platform_spiflashstore.h
* @file gd32f470_mcu.h
*
*/
/* Copyright (C) 2022 by Arjan van Vught mailto:info@orangepi-dmx.nl
/* Copyright (C) 2024 by Arjan van Vught mailto:info@gd32-dmx.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -23,18 +23,31 @@
* THE SOFTWARE.
*/

#ifndef PLATFORM_SPIFLASHSTORE_H_
#define PLATFORM_SPIFLASHSTORE_H_

#if defined (GD32)
# include "gd32.h"
# if !defined (GD32F4XX)
# define SECTION_FLASHSTORE
# else
# define SECTION_FLASHSTORE __attribute__ ((section (".flashstore")))
# endif
#else
# define SECTION_FLASHSTORE
#ifndef MCU_GD32F470_MCU_H_
#define MCU_GD32F470_MCU_H_

#if !defined(GD32F470)
# error This file should not be included
#endif

#endif /* PLATFORM_SPIFLASHSTORE_H_ */
#include <stdint.h>

/**
* rcu_timer_clock_prescaler_config(RCU_TIMER_PSC_MUL4);
*
* CK_APB1 x 4 = 240000000
* TIMER1,2,3,4,5,6,11,12,13
*
* CK_APB2 x 2 = 240000000
* TIMER0,7,8,9,10
*/

#define MCU_CLOCK_FREQ (uint32_t)(240000000)
#define APB1_CLOCK_FREQ (uint32_t)(60000000)
#define APB2_CLOCK_FREQ (uint32_t)(120000000)
#define TIMER_PSC_1MHZ (uint16_t)(239)
#define TIMER_PSC_10KHZ (uint16_t)(23999)

#include "gd32f4xx_mcu.h"

#endif /* MCU_GD32F470_MCU_H_ */
4 changes: 2 additions & 2 deletions lib-hal/Rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ ifneq ($(MAKE_FLAGS),)
endif

ifdef FATFS
EXTRA_SRCDIR+=ff12c ff12c/option
# EXTRA_SRCDIR+=ff14b/source
# EXTRA_SRCDIR+=ff12c ff12c/option
EXTRA_SRCDIR+=ff14b/source
EXTRA_SRCDIR+=posix
endif

Expand Down
8 changes: 5 additions & 3 deletions lib-hal/device/usb/host/gd32/usb_host_msc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* usb_host_msc.cpp
*
*/
/* Copyright (C) 2023 by Arjan van Vught mailto:info@gd32-dmx.org
/* Copyright (C) 2023-2024 by Arjan van Vught mailto:info@gd32-dmx.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -38,10 +38,12 @@ extern "C" {
void console_error(const char *);
}

#include "../lib-hal/ff12c/ff.h"
// #include "../lib-hal/ff12c/ff.h"
#include "../lib-hal/ff14b/source/ff.h"
#include "device/usb/host.h"

#if (_FFCONF == 68300) // R0.12c
//#if (_FFCONF == 68300) // R0.12c
#if (FF_DEFINED == 86631) // R0.14b
static FATFS fat_fs;
#else
# error Not a recognized/tested FatFs version
Expand Down
Loading

0 comments on commit a7226d5

Please sign in to comment.