diff --git a/boards/native/board.c b/boards/native/drivers/native-qdec.c similarity index 96% rename from boards/native/board.c rename to boards/native/drivers/native-qdec.c index a079e5b58b..cdab0a078d 100644 --- a/boards/native/board.c +++ b/boards/native/drivers/native-qdec.c @@ -20,6 +20,8 @@ #include #include +#ifdef MODULE_PERIPH_QDEC + extern int32_t qdecs_value[QDEC_NUMOF]; void native_motor_driver_qdec_simulation( @@ -52,3 +54,5 @@ void native_motor_driver_qdec_simulation( motor_driver, motor_id); } } + +#endif /* MODULE_PERIPH_QDEC */ diff --git a/boards/native/include/board.h b/boards/native/include/board.h index 0df988bd9f..1d9061c2d7 100644 --- a/boards/native/include/board.h +++ b/boards/native/include/board.h @@ -141,7 +141,7 @@ void native_motor_driver_qdec_simulation( \ int32_t pwm_duty_cycle); /* C++ standard do not support designated initializers */ -#ifndef __cplusplus +#if !(defined __cplusplus) && (defined MODULE_PERIPH_QDEC) /** * @name Describe DC motors with PWM channel and GPIOs