From cb4e165071ad56c4cf881f5221f02eeefde5de53 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Thu, 24 May 2018 12:49:23 -0400 Subject: command: Prefer uint8_t* for buffers; prefer uint8_fast_t for lengths Prefer using 'uint8_t' buffers as it is too easy to run into C sign extension problems with 'char' buffers. Prefer using 'uint_fast8_t' for buffer lengths as gcc does a better job compiling them on 32bit mcus. Signed-off-by: Kevin O'Connor --- src/avr/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/avr/main.c') diff --git a/src/avr/main.c b/src/avr/main.c index 2655d307..57aa3c01 100644 --- a/src/avr/main.c +++ b/src/avr/main.c @@ -54,7 +54,7 @@ DECL_INIT(prescaler_init); // Optimized crc16_ccitt for the avr processor uint16_t -crc16_ccitt(char *buf, uint8_t len) +crc16_ccitt(uint8_t *buf, uint_fast8_t len) { uint16_t crc = 0xFFFF; while (len--) -- cgit v1.2.3-70-g09d2