refactor: use uint8_t for serial buffers
Match crsf.h's use of fixed-width types for byte buffers instead of unsigned char.
This commit is contained in:
+2
-2
@@ -37,7 +37,7 @@ void cel_serial_close(cel_serial_port* port) {
|
||||
free(port);
|
||||
}
|
||||
|
||||
size_t cel_serial_read(cel_serial_port* port, unsigned char* buf, size_t len, int timeout_ms) {
|
||||
size_t cel_serial_read(cel_serial_port* port, uint8_t* buf, size_t len, int timeout_ms) {
|
||||
(void)port;
|
||||
(void)buf;
|
||||
(void)len;
|
||||
@@ -46,7 +46,7 @@ size_t cel_serial_read(cel_serial_port* port, unsigned char* buf, size_t len, in
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t cel_serial_write(cel_serial_port* port, unsigned char const* buf, size_t len) {
|
||||
size_t cel_serial_write(cel_serial_port* port, uint8_t const* buf, size_t len) {
|
||||
(void)port;
|
||||
(void)buf;
|
||||
(void)len;
|
||||
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/* Opaque serial port handle */
|
||||
typedef struct cel_serial_port cel_serial_port;
|
||||
@@ -15,10 +16,10 @@ cel_serial_port* cel_serial_open(char const* path, int baud_rate);
|
||||
void cel_serial_close(cel_serial_port* port);
|
||||
|
||||
/* Read up to len bytes. Returns bytes read, 0 on timeout/error. */
|
||||
size_t cel_serial_read(cel_serial_port* port, unsigned char* buf, size_t len, int timeout_ms);
|
||||
size_t cel_serial_read(cel_serial_port* port, uint8_t* buf, size_t len, int timeout_ms);
|
||||
|
||||
/* Write data. Returns bytes written, 0 on error. */
|
||||
size_t cel_serial_write(cel_serial_port* port, unsigned char const* buf, size_t len);
|
||||
size_t cel_serial_write(cel_serial_port* port, uint8_t const* buf, size_t len);
|
||||
|
||||
/* Flush output buffer */
|
||||
void cel_serial_flush(cel_serial_port* port);
|
||||
|
||||
Reference in New Issue
Block a user