mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-30 12:50:58 +00:00
Use UART_DEBUG
This commit is contained in:
1 parent
736a78faed
commit
06b79600ac
3 files changed
+7
-2
No files matched your search
@@ -23,7 +23,8 @@ flash: firmware.bin
|
|||||||
|
|
||||||
# Requires env variable VCON_API_KEY set
|
# Requires env variable VCON_API_KEY set
|
||||||
DEVICE_URL ?= https://dash.vcon.io/api/v3/devices/2
|
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
|
curl --fail -su :$(VCON_API_KEY) $(DEVICE_URL)/tx?t=5 | tee /tmp/output.txt
|
||||||
grep 'Ethernet: up' /tmp/output.txt
|
grep 'Ethernet: up' /tmp/output.txt
|
||||||
grep 'MQTT connected' /tmp/output.txt
|
grep 'MQTT connected' /tmp/output.txt
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ int main(void) {
|
|||||||
gpio_output(LED2); // Setup blue LED
|
gpio_output(LED2); // Setup blue LED
|
||||||
gpio_input(BTN1); // Set button to input
|
gpio_input(BTN1); // Set button to input
|
||||||
irq_exti_attach(BTN1); // Attach BTN1 to exti
|
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));
|
MG_INFO(("Starting, CPU freq %g MHz", (double) SYS_FREQUENCY / 1000000));
|
||||||
|
|
||||||
|
|||||||
@@ -157,6 +157,10 @@ struct uart {
|
|||||||
#define UART2 ((struct uart *) 0x40004400)
|
#define UART2 ((struct uart *) 0x40004400)
|
||||||
#define UART3 ((struct uart *) 0x40004800)
|
#define UART3 ((struct uart *) 0x40004800)
|
||||||
|
|
||||||
|
#ifndef UART_DEBUG
|
||||||
|
#define UART_DEBUG UART3
|
||||||
|
#endif
|
||||||
|
|
||||||
static inline void uart_init(struct uart *uart, unsigned long baud) {
|
static inline void uart_init(struct uart *uart, unsigned long baud) {
|
||||||
// https://www.st.com/resource/en/datasheet/stm32f429zi.pdf
|
// https://www.st.com/resource/en/datasheet/stm32f429zi.pdf
|
||||||
uint8_t af = 7; // Alternate function
|
uint8_t af = 7; // Alternate function
|
||||||
|
|||||||
Reference in new issue
Block a user