aboutsummaryrefslogtreecommitdiff
path: root/stm32f091/protocol.c
diff options
context:
space:
mode:
authorUnavailableDev <69792062+UnavailableDev@users.noreply.github.com>2022-10-30 17:42:03 +0100
committerGitHub <noreply@github.com>2022-10-30 17:42:03 +0100
commitb82a9c44d0112f5433c4482e2e5802969515ce7d (patch)
tree907451385d246dc61b513f3a27043f32b058268a /stm32f091/protocol.c
parent84341bc53bca3da581ba59f66bf4174420c83d3a (diff)
parentfc95a016d13c1510a024888c1b87bbfe1a7f7601 (diff)
Merge branch 'dev' into qt-settings
Diffstat (limited to 'stm32f091/protocol.c')
-rw-r--r--stm32f091/protocol.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/stm32f091/protocol.c b/stm32f091/protocol.c
index f4be08f..405ceb8 100644
--- a/stm32f091/protocol.c
+++ b/stm32f091/protocol.c
@@ -7,7 +7,7 @@
#include "esp8266.h"
void ws_protocol_res_last_records(ws_s_protocol_parsed_req_cmd* parsed_cmd, ws_s_protocol_res* response, bool send) {
- static int record_amount = 0;
+ static unsigned int record_amount = 0;
static unsigned int record_offset = 0;
const char* response_header = "id,temperature,humidity,atmospheric_pressure\n";
const unsigned int response_line_len = strlen("xxxx,xx,xx,xx\n");
@@ -21,7 +21,7 @@ void ws_protocol_res_last_records(ws_s_protocol_parsed_req_cmd* parsed_cmd, ws_s
if (sscanf(parsed_cmd->argv[2], "%x", &record_offset) < 1) response->success = WS_PROTOCOL_CMD_RETURN_ERROR;
else {
record_amount = WS_MIN(record_amount + record_offset, ws_backlog_get_record_count());
- record_amount = WS_MAX(0, record_amount - record_offset);
+ record_amount = WS_MAX(0, (int) record_amount - (int) record_offset);
response->msg->bytes = strlen(response_header) + response_line_len * record_amount;
}
} else {