From 83c7f18dd0201065c035881637386fabd7a58a74 Mon Sep 17 00:00:00 2001 From: joeycastillo Date: Sun, 27 Oct 2024 14:27:55 -0400 Subject: [PATCH] use char instead of uint8_t to match gossamer API --- watch-faces/demo/irda_demo_face.c | 2 +- watch-library/hardware/watch/watch_uart.c | 4 ++-- watch-library/shared/watch/watch_uart.h | 4 ++-- watch-library/simulator/watch/watch_uart.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/watch-faces/demo/irda_demo_face.c b/watch-faces/demo/irda_demo_face.c index 86dd845e..3b22e4a1 100644 --- a/watch-faces/demo/irda_demo_face.c +++ b/watch-faces/demo/irda_demo_face.c @@ -63,7 +63,7 @@ bool irda_demo_face_loop(movement_event_t event, void *context) { case EVENT_ACTIVATE: case EVENT_TICK: { - uint8_t data[32]; + char data[32]; size_t bytes_read = uart_read_instance(0, data, 32); if (bytes_read) { char buf[14]; diff --git a/watch-library/hardware/watch/watch_uart.c b/watch-library/hardware/watch/watch_uart.c index a1518b99..15f305a0 100644 --- a/watch-library/hardware/watch/watch_uart.c +++ b/watch-library/hardware/watch/watch_uart.c @@ -61,11 +61,11 @@ void watch_enable_uart(const uint16_t tx_pin, const uint16_t rx_pin, uint32_t ba uart_enable_instance(3); } -void watch_uart_puts(uint8_t *s) { +void watch_uart_puts(char *s) { uart_write_instance(3, s, strlen((const char *)s)); } -size_t watch_uart_gets(uint8_t *data, size_t max_length) { +size_t watch_uart_gets(char *data, size_t max_length) { return uart_read_instance(3, data, max_length); } diff --git a/watch-library/shared/watch/watch_uart.h b/watch-library/shared/watch/watch_uart.h index bcbcd4db..5dbc5007 100644 --- a/watch-library/shared/watch/watch_uart.h +++ b/watch-library/shared/watch/watch_uart.h @@ -45,14 +45,14 @@ void watch_enable_uart(const uint16_t tx_pin, const uint16_t rx_pin, uint32_t ba /** @brief Transmits a string of bytes on the UART's TX pin. * @param s A null-terminated string containing the bytes you wish to transmit. */ -void watch_uart_puts(uint8_t *s); +void watch_uart_puts(char *s); /** @brief Returns a string of bytes received on the UART's RX pin. * @param data A pointer to a buffer where the received bytes will be stored. * @param max_length The maximum number of bytes to receive. * @return The number of bytes actually received into the buffer. */ -size_t watch_uart_gets(uint8_t *data, size_t max_length); +size_t watch_uart_gets(char *data, size_t max_length); /// @} #endif diff --git a/watch-library/simulator/watch/watch_uart.c b/watch-library/simulator/watch/watch_uart.c index f523cce2..eafbdfbd 100644 --- a/watch-library/simulator/watch/watch_uart.c +++ b/watch-library/simulator/watch/watch_uart.c @@ -32,13 +32,13 @@ void watch_enable_uart(const uint16_t tx_pin, const uint16_t rx_pin, uint32_t ba rx_enable = !!rx_pin; } -void watch_uart_puts(uint8_t *s) { +void watch_uart_puts(char *s) { if (tx_enable) { // TODO: hook up to UI } } -size_t watch_uart_gets(uint8_t *data, size_t max_length) { +size_t watch_uart_gets(char *data, size_t max_length) { if (rx_enable) { // TODO: hook up to UI }