From 5683281b5da2683214c3c108928b558ca95b07a2 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Fri, 19 May 2023 21:51:44 +0200 Subject: [PATCH 1/2] drivers/dfplayer: fix bug in utility function Apparently, those functions have never been used. Otherwise this obvious bug wouldn't have sailed unnoticed for so long. --- drivers/dfplayer/include/dfplayer_implementation.h | 8 ++++---- drivers/include/dfplayer.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/dfplayer/include/dfplayer_implementation.h b/drivers/dfplayer/include/dfplayer_implementation.h index def994743c..40de2bb69e 100644 --- a/drivers/dfplayer/include/dfplayer_implementation.h +++ b/drivers/dfplayer/include/dfplayer_implementation.h @@ -240,16 +240,16 @@ static inline int dfplayer_source_set_contains(dfplayer_source_set_t set, return (set & (0x01 << src)) ? 1 : 0; } -static inline void dfplayer_source_set_add(dfplayer_source_set_t set, +static inline void dfplayer_source_set_add(dfplayer_source_set_t *set, dfplayer_source_t src) { - set |= 0x01 << src; + *set |= 0x01 << src; } -static inline void dfplayer_source_set_rm(dfplayer_source_set_t set, +static inline void dfplayer_source_set_rm(dfplayer_source_set_t *set, dfplayer_source_t src) { - set &= ~((dfplayer_source_set_t)(0x01 << src)); + *set &= ~((dfplayer_source_set_t)(0x01 << src)); } #endif /* !DOXYGEN */ diff --git a/drivers/include/dfplayer.h b/drivers/include/dfplayer.h index 5377fe3d19..5efc2a6aab 100644 --- a/drivers/include/dfplayer.h +++ b/drivers/include/dfplayer.h @@ -752,7 +752,7 @@ static inline int dfplayer_source_set_contains(dfplayer_source_set_t set, * * This function is idempotent */ -static inline void dfplayer_source_set_add(dfplayer_source_set_t set, +static inline void dfplayer_source_set_add(dfplayer_source_set_t *set, dfplayer_source_t src); /** @@ -763,7 +763,7 @@ static inline void dfplayer_source_set_add(dfplayer_source_set_t set, * * This function is idempotent */ -static inline void dfplayer_source_set_rm(dfplayer_source_set_t set, +static inline void dfplayer_source_set_rm(dfplayer_source_set_t *set, dfplayer_source_t src); #ifdef __cplusplus From bc1c831d3981019ce6b3cb293ca55ada79172111 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Fri, 19 May 2023 21:58:14 +0200 Subject: [PATCH 2/2] drivers/pcf857x: fix error handling This fixes a typo/copy paste error in the error handling. --- drivers/pcf857x/pcf857x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pcf857x/pcf857x.c b/drivers/pcf857x/pcf857x.c index f7f4e8b224..d74c4a8a18 100644 --- a/drivers/pcf857x/pcf857x.c +++ b/drivers/pcf857x/pcf857x.c @@ -141,7 +141,7 @@ int pcf857x_init(pcf857x_t *dev, const pcf857x_params_t *params) _release(dev); - return PCF857X_OK; + return res; } int pcf857x_gpio_init(pcf857x_t *dev, gpio_t pin, gpio_mode_t mode)