Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions radio/src/gui/128x64/model_setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,8 @@ void menuModelSetup(event_t event)
INTERNAL_MODULE_CHANNELS_ROWS,
#endif
#if defined(PCBI6X)
IF_INTERNAL_MODULE_ON(1), // Subtype
IF_INTERNAL_MODULE_ON(1), // Servo Freq
IF_INTERNAL_MODULE_ON((g_model.moduleData[INTERNAL_MODULE].rfProtocol==PROTO_AFHDS2A_SPI)?1:HIDDEN_ROW), // Subtype
IF_INTERNAL_MODULE_ON((g_model.moduleData[INTERNAL_MODULE].rfProtocol==PROTO_AFHDS2A_SPI)?1:HIDDEN_ROW), // Servo Freq
#endif
IF_INTERNAL_MODULE_ON(HAS_RF_PROTOCOL_MODELINDEX(g_model.moduleData[INTERNAL_MODULE].rfProtocol) ? (uint8_t)2 : (uint8_t)1),
IF_INTERNAL_MODULE_ON(FAILSAFE_ROWS(INTERNAL_MODULE)),
Expand Down Expand Up @@ -788,9 +788,12 @@ void menuModelSetup(event_t event)
EE_MODEL,
isRfProtocolAvailable);
if (checkIncDec_Ret) { // modified?
g_model.moduleData[INTERNAL_MODULE].type = MODULE_TYPE_AFHDS2A_SPI;
if (g_model.moduleData[INTERNAL_MODULE].rfProtocol == RF_PROTO_OFF){
if (g_model.moduleData[INTERNAL_MODULE].rfProtocol == RF_I6X_PROTO_OFF){
g_model.moduleData[INTERNAL_MODULE].type = MODULE_TYPE_NONE;
}else if(g_model.moduleData[INTERNAL_MODULE].rfProtocol == RF_I6X_PROTO_AFHDS2A){
g_model.moduleData[INTERNAL_MODULE].type = MODULE_TYPE_AFHDS2A_SPI;
}else{
g_model.moduleData[INTERNAL_MODULE].type = MODULE_TYPE_AFHDS_SPI;
}
}
}
Expand Down
9 changes: 6 additions & 3 deletions radio/src/myeeprom.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ enum CurveRefType {
#define GV1_LARGE 1024
#define GV_RANGE_WEIGHT 500
#define GV_RANGE_OFFSET 500
#define DELAY_MAX 250 /* 25 seconds */
#define SLOW_MAX 250 /* 25 seconds */
#define DELAY_MAX 250 /* 25 seconds */
#define SLOW_MAX 250 /* 25 seconds */

#define MD_WEIGHT(md) (md->weight)
#define MD_WEIGHT_TO_UNION(md, var) var.word = md->weight
Expand Down Expand Up @@ -343,6 +343,7 @@ enum Protocols {
#endif
#if defined(PCBI6X)
PROTO_AFHDS2A_SPI,
PROTO_AFHDS_SPI,
#endif
PROTO_NONE
};
Expand All @@ -366,7 +367,8 @@ enum XJTRFProtocols {
enum I6XProtocols {
RF_I6X_PROTO_OFF = -1,
RF_I6X_PROTO_AFHDS2A,
RF_I6X_PROTO_LAST = RF_I6X_PROTO_AFHDS2A
RF_I6X_PROTO_AFHDS,
RF_I6X_PROTO_LAST = RF_I6X_PROTO_AFHDS
};

enum R9MSubTypes {
Expand Down Expand Up @@ -472,6 +474,7 @@ enum ModuleTypes {
MODULE_TYPE_SBUS,
#endif
MODULE_TYPE_AFHDS2A_SPI,
MODULE_TYPE_AFHDS_SPI,
MODULE_TYPE_COUNT
};

Expand Down
12 changes: 10 additions & 2 deletions radio/src/pulses/pulses_arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ uint8_t getRequiredProtocol(uint8_t port) {
required_protocol = PROTO_PXX;
break;
#endif
case MODULE_TYPE_AFHDS_SPI:
required_protocol = PROTO_AFHDS_SPI;
break;
case MODULE_TYPE_AFHDS2A_SPI:
required_protocol = PROTO_AFHDS2A_SPI;
break;
Expand Down Expand Up @@ -150,7 +153,7 @@ bool setupPulses(uint8_t port) {
bool send = false;

uint8_t required_protocol = getRequiredProtocol(port);

heartbeat |= (HEART_TIMER_PULSES << port);

if (s_current_protocol[port] != required_protocol) {
Expand Down Expand Up @@ -185,8 +188,9 @@ bool setupPulses(uint8_t port) {
#if defined(MULTIMODULE)
case PROTO_MULTIMODULE:
#endif
case PROTO_AFHDS_SPI:
case PROTO_AFHDS2A_SPI:
disable_afhds2a(port);
disable_internal_rf(port);
break;
#if !defined(PCBI6X)
case PROTO_SBUS:
Expand Down Expand Up @@ -320,6 +324,10 @@ bool setupPulses(uint8_t port) {
case PROTO_PPM:
init_ppm(port);
break;
case PROTO_AFHDS_SPI:
init_afhds(port);
mixerSchedulerSetPeriod(INTERNAL_MODULE, 3860);
break;
case PROTO_AFHDS2A_SPI:
init_afhds2a(port);
mixerSchedulerSetPeriod(INTERNAL_MODULE, 3860);
Expand Down
Loading