From d133d30f6295c42f3383d57458e25c3b077cce3f Mon Sep 17 00:00:00 2001 From: Yaroslav Chvanov Date: Thu, 21 Apr 2022 19:15:17 +0300 Subject: [PATCH] sinowealth: add numeric IDs to sensor types These IDs match the ones in SinoWealth's configuration software. --- src/driver-sinowealth.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/driver-sinowealth.c b/src/driver-sinowealth.c index 694f4418..12b3c05b 100644 --- a/src/driver-sinowealth.c +++ b/src/driver-sinowealth.c @@ -105,11 +105,14 @@ struct sinowealth_color { } __attribute__((packed)); _Static_assert(sizeof(struct sinowealth_color) == 3, "Invalid size"); +/* Sensor IDs used in SinoWealth firmware and software. */ enum sinowealth_sensor { - PWM3327, - PWM3360, - PWM3389, -}; + SINOWEALTH_SENSOR_NONE, + PWM3360 = 0x06, + PWM3327 = 0x0e, + PWM3389 = 0x0f, +} __attribute__((packed)); +_Static_assert(sizeof(enum sinowealth_sensor) == sizeof(uint8_t), "Invalid sensor enum size"); enum sinowealth_rgb_effect { RGB_OFF = 0,