-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
actuators_mkk.makefile
44 lines (38 loc) · 1.27 KB
/
actuators_mkk.makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#
# Mikrokopter Actuators
#
# enable the subsystem for your firmware:
# <firmware name="rotorcraft">
# ...
# <subsystem name="actuators" type="mkk">
# <configure name="MKK_I2C_SCL_TIME" value="50"/> <!-- this is optional, 150 is default, use 50 for 8 motors-->
# </subsystem>
# <define name="I2C_TRANSACTION_QUEUE_LEN" value="10"/> <!-- default is 8, increase to 10 or more for 8 motors-->
# </firmware>
#
#
# required xml configuration:
# <section name="ACTUATORS_MKK" prefix="ACTUATORS_MKK_">
# <define name="NB" value="4"/>
# <define name="ADDR" value="{ 0x52, 0x54, 0x56, 0x58 }"/>
# </section>
#
# servo section with driver="Mkk"
# command_laws section to map motor_mixing commands to servos
#
$(TARGET).CFLAGS += -DACTUATORS
ap.srcs += subsystems/actuators/actuators_mkk.c
ifeq ($(ARCH), lpc21)
# set default i2c timing if not already configured
ifeq ($(MKK_I2C_SCL_TIME), )
MKK_I2C_SCL_TIME=150
endif
ap.CFLAGS += -DACTUATORS_MKK_DEVICE=i2c0
ap.CFLAGS += -DUSE_I2C0 -DI2C0_SCLL=$(MKK_I2C_SCL_TIME) -DI2C0_SCLH=$(MKK_I2C_SCL_TIME) -DI2C0_VIC_SLOT=11
else ifeq ($(ARCH), stm32)
ap.CFLAGS += -DACTUATORS_MKK_DEVICE=i2c1
ap.CFLAGS += -DUSE_I2C1
endif
# Simulator
nps.srcs += subsystems/actuators/actuators_mkk.c
nps.CFLAGS += -DUSE_I2C0 -DACTUATORS_MKK_DEVICE=i2c0