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 Dec 2, 2023
1 parent 15013aa commit 5417cc0
Show file tree
Hide file tree
Showing 71 changed files with 1,155 additions and 838 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1700506419;
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1701537095;
3 changes: 2 additions & 1 deletion gd32_emac_artnet_pixel_multi/include/sofware_version_id.h
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1700506448;
// Generated do 14 sep 2023 12:39:29 CEST
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1694687969;
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser" keep-relative-paths="false" name="CDT GCC Build Output Parser" parameter="([^/\\\\]*)((g?cc)|([gc]\+\+)|(clang))" prefer-non-shared="true"/>
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-959592491299368322" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-987082377398814242" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand Down
3 changes: 2 additions & 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,2 @@
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1700506457;
// Generated do 14 sep 2023 12:39:32 CEST
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1694687972;
2 changes: 1 addition & 1 deletion gd32_emac_ddp_pixel_multi/.settings/language.settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser" keep-relative-paths="false" name="CDT GCC Build Output Parser" parameter="([^/\\\\]*)((g?cc)|([gc]\+\+)|(clang))" prefer-non-shared="true"/>
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-959592491299368322" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-987082377398814242" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand Down
3 changes: 2 additions & 1 deletion gd32_emac_ddp_pixel_multi/include/sofware_version_id.h
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1700506466;
// Generated do 14 sep 2023 12:39:34 CEST
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1694687974;

This file was deleted.

3 changes: 2 additions & 1 deletion gd32_emac_e131_pixel_multi/include/sofware_version_id.h
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1700506484;
// Generated do 14 sep 2023 12:39:46 CEST
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1694687986;
1 change: 1 addition & 0 deletions include/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ extern "C" {

extern char *strerror(int errnum);
extern char *strtok(char *str, const char *delim);
extern char *strstr(const char *string, const char *substring);

inline int memcmp(const void *s1, const void *s2, size_t n) {
unsigned char u1, u2;
Expand Down
9 changes: 6 additions & 3 deletions lib-c++/.settings/language.settings.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project>
<configuration id="cdt.managedbuild.toolchain.gnu.cross.base.1040880586.393757927" name="GD32">
<configuration id="cdt.managedbuild.toolchain.gnu.cross.base.346413883" name="GD32">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider-reference id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser" keep-relative-paths="false" name="CDT GCC Build Output Parser" parameter="([^/\\\\]*)((g?cc)|([gc]\+\+)|(clang))" prefer-non-shared="true"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-987082377398814242" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
</extension>
</configuration>
Expand Down
70 changes: 70 additions & 0 deletions lib-c/src/strstr.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
* strstr.c --
*
* Source code for the "strstr" library routine.
*
* Copyright (c) 1988-1993 The Regents of the University of California.
* Copyright (c) 1994 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
* RCS: @(#) $Id: strstr.c,v 1.1.1.3 2003/03/06 00:09:04 landonf Exp $
*/

/*
*----------------------------------------------------------------------
*
* strstr --
*
* Locate the first instance of a substring in a string.
*
* Results:
* If string contains substring, the return value is the
* location of the first matching instance of substring
* in string. If string doesn't contain substring, the
* return value is 0. Matching is done on an exact
* character-for-character basis with no wildcards or special
* characters.
*
* Side effects:
* None.
*
*----------------------------------------------------------------------
*/

#include <stddef.h>

char *
strstr(string, substring)
register char *string; /* String to search. */
char *substring; /* Substring to try to find in string. */
{
register char *a, *b;

/* First scan quickly through the two strings looking for a
* single-character match. When it's found, then compare the
* rest of the substring.
*/

b = substring;
if (*b == 0) {
return string;
}
for ( ; *string != 0; string += 1) {
if (*string != *b) {
continue;
}
a = string;
while (1) {
if (*b == 0) {
return string;
}
if (*a++ != *b++) {
break;
}
}
b = substring;
}
return NULL;
}
2 changes: 1 addition & 1 deletion lib-configstore/.settings/language.settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-379142576950745868" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-379101837820761868" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand Down
9 changes: 2 additions & 7 deletions lib-configstore/Rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ ifneq ($(MAKE_FLAGS),)
ifeq ($(findstring NODE_ARTNET,$(MAKE_FLAGS)), NODE_ARTNET)
EXTRA_SRCDIR+=src/artnet
EXTRA_INCLUDES+=../lib-artnet/include
EXTRA_SRCDIR+=src/rdm
RDM=1
ifeq ($(findstring ARTNET_VERSION=4,$(MAKE_FLAGS)), ARTNET_VERSION=4)
EXTRA_INCLUDES+=../lib-e131/include
Expand All @@ -69,9 +68,7 @@ ifneq ($(MAKE_FLAGS),)

ifeq ($(findstring NODE_NODE,$(MAKE_FLAGS)), NODE_NODE)
EXTRA_SRCDIR+=src/node
EXTRA_INCLUDES+=../lib-node/include
EXTRA_INCLUDES+=../lib-artnet/include ../lib-rdmdiscovery/include
EXTRA_INCLUDES+=../lib-e131/include
EXTRA_INCLUDES+=../lib-node/include ../lib-artnet/include ../lib-e131/include
RDM=1
endif

Expand Down Expand Up @@ -128,15 +125,13 @@ ifneq ($(MAKE_FLAGS),)
ifeq ($(findstring RDM_CONTROLLER,$(MAKE_FLAGS)), RDM_CONTROLLER)
ifdef RDM
else
EXTRA_SRCDIR+=src/rdm
RDM=1
endif
endif

ifeq ($(findstring RDM_RESPONDER,$(MAKE_FLAGS)), RDM_RESPONDER)
ifdef RDM
else
EXTRA_SRCDIR+=src/rdm
RDM=1
endif
EXTRA_INCLUDES+=../lib-rdmresponder/include
Expand All @@ -145,7 +140,6 @@ ifneq ($(MAKE_FLAGS),)
ifeq ($(findstring NODE_RDMNET_LLRP_ONLY,$(MAKE_FLAGS)), NODE_RDMNET_LLRP_ONLY)
ifdef RDM
else
EXTRA_SRCDIR+=src/rdm
RDM=1
endif
endif
Expand All @@ -156,6 +150,7 @@ ifneq ($(MAKE_FLAGS),)
endif

ifdef RDM
EXTRA_SRCDIR+=src/rdm
EXTRA_INCLUDES+=../lib-rdm/include ../lib-rdmsensor/include ../lib-rdmsubdevice/include
endif
else
Expand Down
2 changes: 1 addition & 1 deletion lib-debug/.settings/language.settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-987123116528798242" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-987082377398814242" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand Down
20 changes: 12 additions & 8 deletions lib-displayudf/src/network/ntpclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @file ntpclient.cpp
*
*/
/* Copyright (C) 2021-2022 by Arjan van Vught mailto:[email protected]
/* Copyright (C) 2021-2023 by Arjan van Vught mailto:[email protected]
*
* 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 @@ -27,15 +27,19 @@
#include "display.h"

namespace ntpclient {
void display_status(ntpclient::Status status) {
if (status == ntpclient::Status::IDLE) {
void display_status(const ntpclient::Status status) {
switch (status) {
case ntpclient::Status::STOPPED:
Display::Get()->TextStatus("No NTP Client", Display7SegmentMessage::INFO_NTP);
break;
case ntpclient::Status::IDLE:
Display::Get()->TextStatus("NTP Client", Display7SegmentMessage::INFO_NTP);
return;
}

if (status == ntpclient::Status::FAILED) {
break;
case ntpclient::Status::FAILED:
Display::Get()->TextStatus("Error: NTP", Display7SegmentMessage::ERROR_NTP);
return;
break;
default:
break;
}
}
} // namespace ntpclient
2 changes: 2 additions & 0 deletions lib-dmx/src/rdm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,6 @@ void Rdm::SendRaw(uint32_t nPortIndex, const uint8_t *pRdmData, uint32_t nLength
udelay(RDM_RESPONDER_DATA_DIRECTION_DELAY);

Dmx::Get()->SetPortDirection(nPortIndex, dmx::PortDirection::INP, true);

DEBUG_EXIT
}
6 changes: 3 additions & 3 deletions lib-gd32/include/gd32_uart.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @file gd32_uart.h
*
*/
/* Copyright (C) 2021 by Arjan van Vught mailto:[email protected]
/* Copyright (C) 2021-2023 by Arjan van Vught mailto:[email protected]
*
* 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 @@ -54,11 +54,11 @@ extern void gd32_uart_set_baudrate(const uint32_t usart_periph, uint32_t baudrat
extern void gd32_uart_transmit(const uint32_t usart_periph, const uint8_t *data, uint32_t length);
extern void gd32_uart_transmit_string(const uint32_t uart_base, const char *data);

static inline uint32_t gd32_uart_get_rx_fifo_level(__attribute__((unused)) const uint32_t usart_periph) {
inline uint32_t gd32_uart_get_rx_fifo_level(__attribute__((unused)) const uint32_t usart_periph) {
return 1;
}

static inline uint8_t gd32_uart_get_rx_data(const uint32_t uart_base) {
inline uint8_t gd32_uart_get_rx_data(const uint32_t uart_base) {
return (uint8_t)(GET_BITS(USART_DATA(uart_base), 0U, 8U));
}

Expand Down
4 changes: 2 additions & 2 deletions lib-hal/.settings/language.settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
<project>
<configuration id="cdt.managedbuild.toolchain.gnu.cross.base.999241968" name="GD32">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="true" env-hash="-960065744326087874" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="arm-none-eabi-gcc -nostartfiles -ffreestanding -nostdlib -mcpu=cortex-m3 -mthumb -DBARE_METAL -DGD32 -DGD32F20X_CL ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="true" env-hash="-1001195730784049762" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="arm-none-eabi-gcc -nostartfiles -ffreestanding -nostdlib -mcpu=cortex-m3 -mthumb -DBARE_METAL -DGD32 -DGD32F20X_CL ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser" keep-relative-paths="false" name="CDT GCC Build Output Parser" parameter="([^/\\\\]*)((g?cc)|([gc]\+\+)|(clang))" prefer-non-shared="true"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
</extension>
</configuration>
Expand Down
3 changes: 2 additions & 1 deletion lib-hal/Rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ else
DEFINES+=DEBUG_I2C DEBUG_STACK
DEFINES+=LOGIC_ANALYZER
EXTRA_INCLUDES+=debug/i2c debug/stack
EXTRA_SRCDIR+=console/i2c console/null console/uart0 rtc
EXTRA_SRCDIR+=console/i2c console/null console/uart0
EXTRA_SRCDIR+=posix
EXTRA_SRCDIR+=rtc rtc/i2c
endif
28 changes: 26 additions & 2 deletions lib-hal/include/gd32/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#define GD32_HARDWARE_H_

#include <cstdint>
#include <cstring>
#include <time.h>
#include <uuid/uuid.h>

Expand Down Expand Up @@ -81,8 +82,31 @@ class Hardware {
return Millis() / 1000U;
}

bool SetTime(const struct tm *pTime);
void GetTime(struct tm *pTime);
bool SetTime(__attribute__((unused)) const struct tm *pTime) {
#if !defined(DISABLE_RTC)
m_HwClock.Set(pTime);
return true;
#else
return false;
#endif
}

void GetTime(struct tm *pTime) {
auto ltime = time(nullptr);
const auto *pLocalTime = localtime(&ltime);
memcpy(pTime, pLocalTime, sizeof(struct tm));
}

#if !defined(DISABLE_RTC)
bool SetAlarm(const struct tm *pTime) {
const auto b = m_HwClock.AlarmSet(pTime);
return b;
}

void GetAlarm(struct tm *pTime) {
m_HwClock.AlarmGet(pTime);
}
#endif

const char *GetBoardName(uint8_t &nLength) {
nLength = sizeof(GD32_BOARD_NAME) - 1U;
Expand Down
4 changes: 3 additions & 1 deletion lib-hal/include/hal_spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
# include "rpi/hal_spi.h"
#endif

#include <cstdint>
#ifdef __cplusplus
# include <cstdint>

class HAL_SPI {
void Setup() {
Expand Down Expand Up @@ -80,5 +81,6 @@ class HAL_SPI {
uint8_t m_nChipSelect;
uint8_t m_nMode;
};
#endif

#endif /* HAL_SPI_H_ */
Loading

0 comments on commit 5417cc0

Please sign in to comment.