From 7457c4545adc967441ebefa11e74e829bc64e6f9 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Wed, 31 May 2023 14:42:44 +0200 Subject: [PATCH] drivers/shtcx: fix assertion and shtcx_saul_info idx --- drivers/saul/init_devs/auto_init_shtcx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/saul/init_devs/auto_init_shtcx.c b/drivers/saul/init_devs/auto_init_shtcx.c index b96e720a90..7534a0fe69 100644 --- a/drivers/saul/init_devs/auto_init_shtcx.c +++ b/drivers/saul/init_devs/auto_init_shtcx.c @@ -54,7 +54,7 @@ void auto_init_shtcx(void) { - assert(SHTCX_NUM == SHTCX_INFO_NUM); + assert(2 * SHTCX_NUM == SHTCX_INFO_NUM); for (unsigned i = 0; i < SHTCX_NUM; i++) { LOG_DEBUG("[auto_init_saul] initializing shtcx #%u\n", i); @@ -70,7 +70,7 @@ /* Humidity */ saul_entries[(i * 2)+1].dev = &(shtcx_devs[i]); - saul_entries[(i * 2)+1].name = shtcx_saul_info[i].name; + saul_entries[(i * 2)+1].name = shtcx_saul_info[(i * 2)+1].name; saul_entries[(i * 2)+1].driver = &shtcx_relative_humidity_saul_driver; saul_reg_add(&(saul_entries[(i * 2)]));