mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
boards/native: make compilation of qdec mock conditional
Previously this code was compiled unconditionally which might result in a linking error since qdecs_value is not defined if the periph_qdec module isn't enabled.
This commit is contained in:
parent
cc13558c5e
commit
7c49cbb4a1
@ -20,6 +20,8 @@
|
||||
#include <board.h>
|
||||
#include <log.h>
|
||||
|
||||
#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 */
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user