From 0ee426b4fe304f7cf28baa130874661b96c11bd8 Mon Sep 17 00:00:00 2001 From: Kees Bakker <kees@sodaq.com> Date: Sun, 6 Jan 2019 17:55:47 +0100 Subject: [PATCH] drivers/mm7660: correct cast of phydat_t* The read functions have a mma7660_data_t* argument which is a struct with 3 int16_t members. Thus we should cast res->val instead of just res. --- drivers/mma7660/mma7660_saul.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mma7660/mma7660_saul.c b/drivers/mma7660/mma7660_saul.c index ef0014ae66..5d202e1d9c 100644 --- a/drivers/mma7660/mma7660_saul.c +++ b/drivers/mma7660/mma7660_saul.c @@ -26,7 +26,7 @@ static int read_acc(const void *dev, phydat_t *res) { - mma7660_read((const mma7660_t *)dev, (mma7660_data_t *)res); + mma7660_read((const mma7660_t *)dev, (mma7660_data_t *)res->val); res->unit = UNIT_G; res->scale = -3; -- GitLab