Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ LDFLAGS += -nostartfiles -nodefaultlibs ${CFLAGS} -lgcc
CFLAGS += -ffunction-sections -fdata-sections -Wno-attributes
LDFLAGS += -Wl,--gc-sections -Wl,--build-id=sha1

ifdef BTS
BUILD_TIMESTAMP := $(shell date "+%Y-%m-%d %H:%M:%S")
CFLAGS += -DMIOS_BUILD_TIMESTAMP="\"${BUILD_TIMESTAMP}\""
# Make sure the version.c gets recompiled for new timestamp
.PHONY: ${SRC}/version.c
endif

# Needed for linker script includes
LDFLAGS += -L${SRC}

Expand Down
4 changes: 2 additions & 2 deletions src/platform/stm32h7/stm32h7_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -674,9 +674,9 @@ stm32h7_eth_init(gpio_t phyrst, const uint8_t *gpios, size_t gpio_count,
gpio_conf_output(phyrst, GPIO_PUSH_PULL,
GPIO_SPEED_LOW, GPIO_PULL_NONE);
gpio_set_output(phyrst, 0);
udelay(10);
udelay(50);
gpio_set_output(phyrst, 1);
udelay(10);
udelay(4000);
}

clk_enable(CLK_ETH1MACEN);
Expand Down
6 changes: 3 additions & 3 deletions src/platform/stm32h7/stm32h7_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void irq_96(void) { i2c_irq(g_i2c[3]); }

i2c_t *
stm32h7_i2c_create(unsigned int instance, gpio_t scl, gpio_t sda,
gpio_pull_t pull, int scl_freq)
gpio_pull_t pull, int scl_freq, int af)
{
instance--;
if(instance > ARRAYSIZE(i2c_configs))
Expand All @@ -74,8 +74,8 @@ stm32h7_i2c_create(unsigned int instance, gpio_t scl, gpio_t sda,
panic("i2c-%d: Unsupported timing", instance + 1);
}

gpio_conf_af(scl, 4, GPIO_OPEN_DRAIN, GPIO_SPEED_HIGH, pull);
gpio_conf_af(sda, 4, GPIO_OPEN_DRAIN, GPIO_SPEED_HIGH, pull);
gpio_conf_af(scl, af, GPIO_OPEN_DRAIN, GPIO_SPEED_HIGH, pull);
gpio_conf_af(sda, af, GPIO_OPEN_DRAIN, GPIO_SPEED_HIGH, pull);

clk_enable(c->clk_id);

Expand Down
2 changes: 1 addition & 1 deletion src/platform/stm32h7/stm32h7_i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
#include <mios/io.h>

i2c_t *stm32h7_i2c_create(unsigned int instance, gpio_t scl, gpio_t sda,
gpio_pull_t pull, int scl_freq);
gpio_pull_t pull, int scl_freq, int af);
3 changes: 3 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ mios_print_version(stream_t *s)

stprintf(s, "Mios version:");
stprintversion(s, _miosversion);
#ifdef MIOS_BUILD_TIMESTAMP
stprintf(s, "Build time: %s\n", MIOS_BUILD_TIMESTAMP);
#endif

stprintf(s, "BuildID: ");
sthexstr(s, mios_build_id(), 20);
Expand Down
Loading