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 Feb 18, 2024
1 parent ef92bd0 commit 1c6f037
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 54 deletions.
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=1708278917;
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=1706294736;
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1708278927;
8 changes: 8 additions & 0 deletions lib-gd32/include/board/gd32f470z_eval.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,14 @@ static constexpr uint32_t PORT_A_TX = 0;
#define SPI_FLASH_WP_GPIO_PINx SPI_IO2_PIN
#define SPI_FLASH_HOLD_GPIO_PINx SPI_IO3_PIN

/**
* USB
*/

#define USB_HOST_VBUS_GPIOx GPIOD
#define USB_HOST_VBUS_RCU_GPIOx RCU_GPIOD
#define USB_HOST_VBUS_GPIO_PINx GPIO_PIN_13

/**
* EXT PHY
*/
Expand Down
21 changes: 20 additions & 1 deletion lib-hal/include/utc.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,32 @@

#include <cstdint>

// https://en.wikipedia.org/wiki/List_of_UTC_time_offsets

namespace hal {
enum class UtcOffset {
UTC_OFFSET_MIN = -12,
UTC_OFFSET_MAX = 14
};

int32_t utc_validate(const float fOffset);
inline int32_t utc_validate(const float fOffset) {
static constexpr float s_ValidOffets[] = { -9.5, -3.5, 3.5, 4.5, 5.5, 5.75, 6.5, 8.75, 9.5, 10.5, 12.75 };
auto nInt = static_cast<int32_t>(fOffset);

if ((nInt >= -12) && (nInt <= 14)) {
if (fOffset == static_cast<float>(nInt)) {
return (nInt * 3600);
} else {
for (uint32_t i = 0; i < sizeof(s_ValidOffets) / sizeof(s_ValidOffets[0]); i++) {
if (fOffset == s_ValidOffets[i]) {
return static_cast<int32_t>(fOffset * 3600.0f);
}
}
}
}

return 0;
}
} // namespace hal

#endif /* UTC_H_ */
50 changes: 0 additions & 50 deletions lib-hal/src/utc.cpp

This file was deleted.

2 changes: 1 addition & 1 deletion lib-network/src/net/arp_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ void arp_cache_dump() {
}

#ifndef NDEBUG
void arp_cache_timer(void) {
void arp_cache_timer() {
s_ticker--;

if (s_ticker == 0) {
Expand Down

0 comments on commit 1c6f037

Please sign in to comment.