diff options
-rw-r--r-- | shared/protocol.h | 3 | ||||
-rw-r--r-- | stm32f091/server.c | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/shared/protocol.h b/shared/protocol.h index e5ddf05..310940d 100644 --- a/shared/protocol.h +++ b/shared/protocol.h @@ -143,10 +143,13 @@ ws_protocol_res_handler_t ws_protocol_res_last_records; */ void ws_protocol_send_data(const char* data, unsigned int length); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" /** @brief response handlers, called when a command is parsed */ static ws_protocol_res_handler_t* g_ws_protocol_res_handlers[WS_PROTOCOL_CMD_AMOUNT] = { [WS_PROTOCOL_CMD_LAST_RECORDS] = &ws_protocol_res_last_records, }; +#pragma GCC diagnostic pop /** @brief return length of custom protocol header */ unsigned short ws_protocol_get_header_size(ws_s_protocol_res* response); diff --git a/stm32f091/server.c b/stm32f091/server.c index 1d4a469..903de38 100644 --- a/stm32f091/server.c +++ b/stm32f091/server.c @@ -162,7 +162,7 @@ void ws_server_send(uint8_t* data, size_t size) { } void ws_server_buffer_send_append(uint8_t* data, size_t size) { - size_t limited_size = WS_MIN(size, g_ws_esp8266_dma_tx_buffer_head - g_ws_esp8266_dma_tx_buffer_tail); + size_t limited_size = WS_MIN(size, WS_DMA_TX_BUFFER_SIZE - g_ws_esp8266_dma_tx_buffer_head); strncpy((char*) &g_ws_esp8266_dma_tx_buffer[g_ws_esp8266_dma_tx_buffer_head], (char*) data, limited_size); // append string g_ws_esp8266_dma_tx_buffer_head += size; // shift head } |