mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-02-04 23:58:11 +00:00
Fixed compilation issues due to AFHDS2A introduction
This commit is contained in:
parent
807a55fcdc
commit
8cbbb52b95
@ -16,8 +16,6 @@
|
|||||||
|
|
||||||
#ifdef AFHDS2A_A7105_INO
|
#ifdef AFHDS2A_A7105_INO
|
||||||
|
|
||||||
#define AFHDS2A_EEPROMadress 0 // rx ID 32bit
|
|
||||||
|
|
||||||
#define AFHDS2A_TXPACKET_SIZE 38
|
#define AFHDS2A_TXPACKET_SIZE 38
|
||||||
#define AFHDS2A_RXPACKET_SIZE 37
|
#define AFHDS2A_RXPACKET_SIZE 37
|
||||||
#define AFHDS2A_NUMFREQ 16
|
#define AFHDS2A_NUMFREQ 16
|
||||||
@ -74,6 +72,7 @@ static void AFHDS2A_calc_channels()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(TELEMETRY)
|
||||||
// telemetry sensors ID
|
// telemetry sensors ID
|
||||||
enum{
|
enum{
|
||||||
AFHDS2A_SENSOR_RX_VOLTAGE = 0x00,
|
AFHDS2A_SENSOR_RX_VOLTAGE = 0x00,
|
||||||
@ -111,6 +110,7 @@ static void AFHDS2A_update_telemetry()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void AFHDS2A_build_bind_packet()
|
static void AFHDS2A_build_bind_packet()
|
||||||
{
|
{
|
||||||
@ -184,6 +184,7 @@ static void AFHDS2A_build_packet(uint8_t type)
|
|||||||
packet[10]= 0xff;
|
packet[10]= 0xff;
|
||||||
packet[12]= 0x00;
|
packet[12]= 0x00;
|
||||||
uint16_t a=5*option+50; // option value should be between 0 and 70 which gives a value between 50 and 400Hz
|
uint16_t a=5*option+50; // option value should be between 0 and 70 which gives a value between 50 and 400Hz
|
||||||
|
if(a<50 || a>400) a=50; // default is 50Hz
|
||||||
packet[11]= a;
|
packet[11]= a;
|
||||||
packet[12]= a >> 8;
|
packet[12]= a >> 8;
|
||||||
if(sub_protocol == PPM_IBUS || sub_protocol == PPM_SBUS)
|
if(sub_protocol == PPM_IBUS || sub_protocol == PPM_SBUS)
|
||||||
@ -291,8 +292,10 @@ uint16_t ReadAFHDS2A()
|
|||||||
A7105_ReadData(AFHDS2A_RXPACKET_SIZE);
|
A7105_ReadData(AFHDS2A_RXPACKET_SIZE);
|
||||||
if(packet[9] == 0xfc)
|
if(packet[9] == 0xfc)
|
||||||
packet_type=AFHDS2A_PACKET_SETTINGS; // RX is asking for settings
|
packet_type=AFHDS2A_PACKET_SETTINGS; // RX is asking for settings
|
||||||
|
#if defined(TELEMETRY)
|
||||||
else
|
else
|
||||||
AFHDS2A_update_telemetry();
|
AFHDS2A_update_telemetry();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
packet_count++;
|
packet_count++;
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#ifndef A7105_INSTALLED
|
#ifndef A7105_INSTALLED
|
||||||
#undef FLYSKY_A7105_INO
|
#undef FLYSKY_A7105_INO
|
||||||
#undef HUBSAN_A7105_INO
|
#undef HUBSAN_A7105_INO
|
||||||
|
#undef AFHDS2A_A7105_INO
|
||||||
#endif
|
#endif
|
||||||
#ifndef CYRF6936_INSTALLED
|
#ifndef CYRF6936_INSTALLED
|
||||||
#undef DEVO_CYRF6936_INO
|
#undef DEVO_CYRF6936_INO
|
||||||
@ -75,7 +76,7 @@
|
|||||||
#if not defined(CYRF6936_INSTALLED) || not defined(DSM_CYRF6936_INO)
|
#if not defined(CYRF6936_INSTALLED) || not defined(DSM_CYRF6936_INO)
|
||||||
#undef DSM_TELEMETRY
|
#undef DSM_TELEMETRY
|
||||||
#endif
|
#endif
|
||||||
#if (not defined(CC2500_INSTALLED) || not defined(FRSKYD_CC2500_INO)) && (not defined(A7105_INSTALLED) || not defined(HUBSAN_A7105_INO))
|
#if (not defined(CC2500_INSTALLED) || not defined(FRSKYD_CC2500_INO)) && (not defined(A7105_INSTALLED) || not defined(HUBSAN_A7105_INO) || not defined(AFHDS2A_A7105_INO))
|
||||||
#undef HUB_TELEMETRY
|
#undef HUB_TELEMETRY
|
||||||
#endif
|
#endif
|
||||||
#if not defined(CC2500_INSTALLED) || not defined(FRSKYX_CC2500_INO)
|
#if not defined(CC2500_INSTALLED) || not defined(FRSKYX_CC2500_INO)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user