From c5479d66b32984f6cab36c1d13300998b817ec9b Mon Sep 17 00:00:00 2001 From: Sergey Kostanbaev Date: Wed, 2 Aug 2017 12:58:37 +0300 Subject: [PATCH] zpu: reduce UART buffer in bootloader mode --- zpu/lib/udp_uart.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/zpu/lib/udp_uart.c b/zpu/lib/udp_uart.c index 84680023..057737fc 100644 --- a/zpu/lib/udp_uart.c +++ b/zpu/lib/udp_uart.c @@ -39,9 +39,16 @@ static const size_t num_idle_cyc_b4_flush = 11; //small but lucky number static uint16_t _base_port; static int8_t _storage_map[MAX_NUM_UARTS]; +#ifdef BOOTLOADER +#define UART_BUF_SZ 16 +#else +#define UART_BUF_SZ 128 +#endif + + typedef struct{ struct socket_address dst; - _AL4 uint8_t buf[256]; + _AL4 uint8_t buf[UART_BUF_SZ]; size_t len; //length of buffer size_t cyc; //idle cycle count } udp_uart_state_t;