<!DOCTYPE airframe SYSTEM "../../airframe.dtd">

<!-- RC transmitter with XBee modem
-->

<airframe name="RC TX">
  <section name="adc" prefix="ADC_CHANNEL_">
    <define name="IR1" value="ADC_1"/>
    <define name="IR2" value="ADC_2"/>
    <define name="IR_TOP" value="ADC_0"/>
    <define name="IR_NB_SAMPLES" value="16"/>
  </section>

  <section name="BAT">
    <define name="CATASTROPHIC_BAT_LEVEL" value="9.3" unit="V"/>
                                        <!-- 0.0247311828 -->
                                        <!-- 0.02432905 -->
    <define name="VoltageOfAdc(adc)" value="(0.02454*adc)"/>
  </section>

 <makefile>

CONFIG = \"tiny_2_1.h\"

include $(PAPARAZZI_SRC)/conf/firmwares/tiny.makefile

FLASH_MODE=IAP

ap.CFLAGS +=  -DFBW -DAP -DCONFIG=$(CONFIG) -DUSE_LED
ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_rctx.c

ap.CFLAGS += -DRADIO_CONTROL -DRADIO_CONTROL_TYPE=RC_FUTABA
ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c

ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B57600
ap.srcs += subsystems/datalink/downlink.c $(SRC_ARCH)/mcu_periph/uart_arch.c subsystems/datalink/xbee.c

ap.CFLAGS += -DUSE_DOWNLINK_BROADCAST

ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2
ap.srcs += $(SRC_ARCH)/adc_hw.c

 </makefile>
</airframe>
