mirror of
https://github.com/cesanta/mongoose.git
synced 2025-08-06 13:37:34 +08:00
Use UART_DEBUG
This commit is contained in:
parent
736a78faed
commit
06b79600ac
@ -23,7 +23,8 @@ flash: firmware.bin
|
||||
|
||||
# Requires env variable VCON_API_KEY set
|
||||
DEVICE_URL ?= https://dash.vcon.io/api/v3/devices/2
|
||||
test: update
|
||||
test: EXTRA_CFLAGS += -DUART_DEBUG=UART1
|
||||
test: update
|
||||
curl --fail -su :$(VCON_API_KEY) $(DEVICE_URL)/tx?t=5 | tee /tmp/output.txt
|
||||
grep 'Ethernet: up' /tmp/output.txt
|
||||
grep 'MQTT connected' /tmp/output.txt
|
||||
|
@ -44,7 +44,7 @@ int main(void) {
|
||||
gpio_output(LED2); // Setup blue LED
|
||||
gpio_input(BTN1); // Set button to input
|
||||
irq_exti_attach(BTN1); // Attach BTN1 to exti
|
||||
uart_init(UART1, 115200); // Initialise debug printf
|
||||
uart_init(UART_DEBUG, 115200); // Initialise debug printf
|
||||
|
||||
MG_INFO(("Starting, CPU freq %g MHz", (double) SYS_FREQUENCY / 1000000));
|
||||
|
||||
|
@ -157,6 +157,10 @@ struct uart {
|
||||
#define UART2 ((struct uart *) 0x40004400)
|
||||
#define UART3 ((struct uart *) 0x40004800)
|
||||
|
||||
#ifndef UART_DEBUG
|
||||
#define UART_DEBUG UART3
|
||||
#endif
|
||||
|
||||
static inline void uart_init(struct uart *uart, unsigned long baud) {
|
||||
// https://www.st.com/resource/en/datasheet/stm32f429zi.pdf
|
||||
uint8_t af = 7; // Alternate function
|
||||
|
Loading…
Reference in New Issue
Block a user