chore: mqtt impl, fix more wiznet bugs

This commit is contained in:
2024-11-10 02:47:54 +06:00
parent 80cf21f143
commit 3ac9c62241
19 changed files with 1093 additions and 253 deletions

View File

@@ -3,13 +3,15 @@
#include <stdint.h>
#define UART1_BAUD_RATE 9600
// Macro definitions
#define APB1_CLOCK (FUNCONF_SYSTEM_CORE_CLOCK / 2) // APB1 is divided by 2
#define UART_BRR_APB1 \
(((APB1_CLOCK) + (UART_BAUD_RATE / 2)) / (UART_BAUD_RATE)) // USART2
#define UART_BRR_APB2 \
(((FUNCONF_SYSTEM_CORE_CLOCK) + (UART_BAUD_RATE / 2)) / \
(UART_BAUD_RATE)) // USART1
(((FUNCONF_SYSTEM_CORE_CLOCK) + (UART1_BAUD_RATE / 2)) / \
(UART1_BAUD_RATE)) // USART1
// Function prototypes
void init_uart(int uart_brr);