@@ -22,7 +22,7 @@ LOG_MODULE_REGISTER(sensor_module, CONFIG_SENSOR_MODULE_LOG_LEVEL);
2222 .error_count = 0, .max_retries = 0, .last_read_time = 0, .read_timeout_ms = 0, \
2323 IF_ENABLED(CONFIG_SENSOR_MODULE_WARMUP_ENABLE, \
2424 (.sensor_init_time = 0, \
25- .sensor_warmup_complete = {false})) \
25+ .sensor_warmup_complete = {false})) \
2626 }
2727
2828/* ZBUS subscriber for sensor requests */
@@ -65,7 +65,7 @@ struct sensor_state_object {
6565 int64_t last_read_time ;
6666 int64_t read_timeout_ms ;
6767
68- #ifdef CONFIG_SENSOR_MODULE_WARMUP_ENABLE
68+ #if defined( CONFIG_SENSOR_MODULE_WARMUP_ENABLE )
6969 /* Sensor warmup tracking */
7070 int64_t sensor_init_time ;
7171 bool sensor_warmup_complete [SENSOR_TYPE_COUNT ];
@@ -132,12 +132,12 @@ static void update_sensor_health(struct sensor_health *health, bool success);
132132static const char * get_sensor_name (enum sensor_type type );
133133static void sensor_set_state (struct sensor_state_object * ctx , enum sensor_module_state new_state );
134134
135- #ifdef CONFIG_SENSOR_MODULE_WARMUP_ENABLE
135+ #if defined( CONFIG_SENSOR_MODULE_WARMUP_ENABLE )
136136static bool is_sensor_warmup_complete (enum sensor_type type );
137137static int64_t get_sensor_warmup_time (enum sensor_type type );
138138#endif
139139
140- #ifdef CONFIG_CCS811_ENV_COMPENSATION
140+ #if defined( CONFIG_CCS811_ENV_COMPENSATION )
141141static int update_ccs811_env_data (const struct sensor_value * temp , const struct sensor_value * hum );
142142static void handle_ccs811_env_compensation (const struct sensor_value * temp ,
143143 const struct sensor_value * hum );
@@ -268,7 +268,7 @@ static void sensor_state_init_run(void *obj)
268268 return ;
269269 }
270270
271- #ifdef CONFIG_SENSOR_MODULE_WARMUP_ENABLE
271+ #if defined( CONFIG_SENSOR_MODULE_WARMUP_ENABLE )
272272 /* Initialize warmup timing */
273273 ctx -> sensor_init_time = k_uptime_get ();
274274 for (int i = 0 ; i < SENSOR_TYPE_COUNT ; i ++ ) {
@@ -322,7 +322,7 @@ static void sensor_state_reading_run(void *obj)
322322 continue ;
323323 }
324324
325- #ifdef CONFIG_SENSOR_MODULE_WARMUP_ENABLE
325+ #if defined( CONFIG_SENSOR_MODULE_WARMUP_ENABLE )
326326 /* Check if sensor warmup is complete */
327327 if (!is_sensor_warmup_complete (i )) {
328328 LOG_DBG ("Sensor SM: %s warmup not complete, skipping read" ,
@@ -337,7 +337,7 @@ static void sensor_state_reading_run(void *obj)
337337 update_sensor_health (& sensors [i ].health , true);
338338 LOG_DBG ("Sensor SM: %s read successful" , get_sensor_name (i ));
339339
340- #ifdef CONFIG_CCS811_ENV_COMPENSATION
340+ #if defined( CONFIG_CCS811_ENV_COMPENSATION )
341341 /* Update CCS811 environmental compensation if BME280 succeeded */
342342 if (i == SENSOR_TYPE_BME280 ) {
343343 handle_ccs811_env_compensation (& ctx -> current_data .temperature ,
@@ -349,7 +349,7 @@ static void sensor_state_reading_run(void *obj)
349349 LOG_WRN ("Sensor SM: %s read failed (%d)" , get_sensor_name (i ), ret );
350350 ctx -> error_count ++ ;
351351
352- #ifdef CONFIG_CCS811_ENV_COMPENSATION
352+ #if defined( CONFIG_CCS811_ENV_COMPENSATION )
353353 /* Use fallback compensation if BME280 failed */
354354 if (i == SENSOR_TYPE_BME280 ) {
355355 handle_ccs811_fallback_compensation ();
@@ -362,7 +362,7 @@ static void sensor_state_reading_run(void *obj)
362362 int enabled_sensor_count = 0 ;
363363 for (int i = 0 ; i < SENSOR_TYPE_COUNT ; i ++ ) {
364364 if (sensors [i ].enabled ) {
365- #ifdef CONFIG_SENSOR_MODULE_WARMUP_ENABLE
365+ #if defined( CONFIG_SENSOR_MODULE_WARMUP_ENABLE )
366366 if (is_sensor_warmup_complete (i )) {
367367 enabled_sensor_count ++ ;
368368 }
@@ -374,7 +374,7 @@ static void sensor_state_reading_run(void *obj)
374374
375375 /* Only publish data if at least one sensor read successfully */
376376 if (successful_reads == 0 ) {
377- #ifdef CONFIG_SENSOR_MODULE_WARMUP_ENABLE
377+ #if defined( CONFIG_SENSOR_MODULE_WARMUP_ENABLE )
378378 /* Check if any sensors are still warming up */
379379 bool any_warming = false;
380380 for (int i = 0 ; i < SENSOR_TYPE_COUNT ; i ++ ) {
@@ -601,7 +601,7 @@ static int read_sensor_data(enum sensor_type type, struct sensor_msg *data)
601601 return 0 ;
602602}
603603
604- #ifdef CONFIG_CCS811_ENV_COMPENSATION
604+ #if defined( CONFIG_CCS811_ENV_COMPENSATION )
605605static int update_ccs811_env_data (const struct sensor_value * temp , const struct sensor_value * hum )
606606{
607607 /* Validate inputs */
@@ -786,7 +786,7 @@ static void sensor_set_state(struct sensor_state_object *ctx, enum sensor_module
786786 smf_set_state (SMF_CTX (ctx ), & sensor_states [new_state ]);
787787}
788788
789- #ifdef CONFIG_SENSOR_MODULE_WARMUP_ENABLE
789+ #if defined( CONFIG_SENSOR_MODULE_WARMUP_ENABLE )
790790/* Helper function to get warmup time for a sensor type */
791791static int64_t get_sensor_warmup_time (enum sensor_type type )
792792{
0 commit comments