diff options
author | lonkaars <loek@pipeframe.xyz> | 2022-10-30 17:31:16 +0100 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2022-10-30 17:31:16 +0100 |
commit | fc95a016d13c1510a024888c1b87bbfe1a7f7601 (patch) | |
tree | 9b98a41d648da3e5acde0897d41cd79c11a7d1e3 /stm32f091/protocol.c | |
parent | d629902140406ac26fa65c1a7d559e6f1798206f (diff) |
squash more todo's
Diffstat (limited to 'stm32f091/protocol.c')
-rw-r--r-- | stm32f091/protocol.c | 4 |
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 { |