diff --git a/docs/Settings.md b/docs/Settings.md index 1a07b67bf22..02ea396e307 100644 --- a/docs/Settings.md +++ b/docs/Settings.md @@ -752,16 +752,6 @@ Re-purpose the craft name field for messages. --- -### dji_workarounds - -Enables workarounds for different versions of MSP protocol used - -| Default | Min | Max | -| --- | --- | --- | -| 1 | 0 | 255 | - ---- - ### dshot_beeper_enabled Whether using DShot motors as beepers is enabled diff --git a/src/main/fc/settings.yaml b/src/main/fc/settings.yaml index 2ea0921ef02..4e2b097204b 100644 --- a/src/main/fc/settings.yaml +++ b/src/main/fc/settings.yaml @@ -4008,12 +4008,6 @@ groups: headers: ["io/osd_dji_hd.h"] condition: USE_DJI_HD_OSD members: - - name: dji_workarounds - description: "Enables workarounds for different versions of MSP protocol used" - field: proto_workarounds - min: 0 - max: UINT8_MAX - default_value: 1 - name: dji_use_name_for_messages description: "Re-purpose the craft name field for messages." default_value: ON diff --git a/src/main/io/osd_dji_hd.c b/src/main/io/osd_dji_hd.c index 29dfe0b809e..d07a153b3dd 100644 --- a/src/main/io/osd_dji_hd.c +++ b/src/main/io/osd_dji_hd.c @@ -122,11 +122,10 @@ * but reuse the packet decoder to minimize code duplication */ -PG_REGISTER_WITH_RESET_TEMPLATE(djiOsdConfig_t, djiOsdConfig, PG_DJI_OSD_CONFIG, 2); +PG_REGISTER_WITH_RESET_TEMPLATE(djiOsdConfig_t, djiOsdConfig, PG_DJI_OSD_CONFIG, 3); PG_RESET_TEMPLATE(djiOsdConfig_t, djiOsdConfig, .use_name_for_messages = SETTING_DJI_USE_NAME_FOR_MESSAGES_DEFAULT, .esc_temperature_source = SETTING_DJI_ESC_TEMP_SOURCE_DEFAULT, - .proto_workarounds = SETTING_DJI_WORKAROUNDS_DEFAULT, .messageSpeedSource = SETTING_DJI_MESSAGE_SPEED_SOURCE_DEFAULT, .rssi_source = SETTING_DJI_RSSI_SOURCE_DEFAULT, .useAdjustments = SETTING_DJI_USE_ADJUSTMENTS_DEFAULT, @@ -1347,12 +1346,11 @@ static mspResult_e djiProcessMspCommand(mspPacket_t *cmd, mspPacket_t *reply, ms break; case DJI_MSP_ESC_SENSOR_DATA: - if (djiOsdConfig()->proto_workarounds & DJI_OSD_USE_NON_STANDARD_MSP_ESC_SENSOR_DATA) { - // Version 1.00.06 of DJI firmware is not using the standard MSP_ESC_SENSOR_DATA + { uint16_t protoRpm = 0; int16_t protoTemp = 0; -#if defined(USE_ESC_SENSOR) + #if defined(USE_ESC_SENSOR) if (STATE(ESC_SENSOR_ENABLED) && getMotorCount() > 0) { uint32_t motorRpmAcc = 0; int32_t motorTempAcc = 0; @@ -1366,7 +1364,7 @@ static mspResult_e djiProcessMspCommand(mspPacket_t *cmd, mspPacket_t *reply, ms protoRpm = motorRpmAcc / getMotorCount(); protoTemp = motorTempAcc / getMotorCount(); } -#endif + #endif switch (djiOsdConfig()->esc_temperature_source) { // This is ESC temperature (as intended) @@ -1391,47 +1389,6 @@ static mspResult_e djiProcessMspCommand(mspPacket_t *cmd, mspPacket_t *reply, ms sbufWriteU8(dst, protoTemp); sbufWriteU16(dst, protoRpm); } - else { - // Use standard MSP_ESC_SENSOR_DATA message - sbufWriteU8(dst, getMotorCount()); - for (int i = 0; i < getMotorCount(); i++) { - uint16_t motorRpm = 0; - int16_t motorTemp = 0; - - // If ESC_SENSOR is enabled, pull the telemetry data and get motor RPM -#if defined(USE_ESC_SENSOR) - if (STATE(ESC_SENSOR_ENABLED)) { - const escSensorData_t * escSensor = getEscTelemetry(i); - motorRpm = escSensor->rpm; - motorTemp = escSensor->temperature; - } -#endif - - // Now populate temperature field (which we may override for different purposes) - switch (djiOsdConfig()->esc_temperature_source) { - // This is ESC temperature (as intended) - case DJI_OSD_TEMP_ESC: - // No-op, temperature is already set to ESC - break; - - // Re-purpose the field for core temperature - case DJI_OSD_TEMP_CORE: - getIMUTemperature(&motorTemp); - motorTemp = motorTemp / 10; - break; - - // Re-purpose the field for baro temperature - case DJI_OSD_TEMP_BARO: - getBaroTemperature(&motorTemp); - motorTemp = motorTemp / 10; - break; - } - - // Add data for this motor to the packet - sbufWriteU8(dst, motorTemp); - sbufWriteU16(dst, motorRpm); - } - } break; case DJI_MSP_OSD_CONFIG: diff --git a/src/main/io/osd_dji_hd.h b/src/main/io/osd_dji_hd.h index 4b3e0a14796..f109f84fb1b 100644 --- a/src/main/io/osd_dji_hd.h +++ b/src/main/io/osd_dji_hd.h @@ -84,7 +84,6 @@ enum djiOsdProtoWorkarounds_e { typedef struct djiOsdConfig_s { uint8_t use_name_for_messages; uint8_t esc_temperature_source; - uint8_t proto_workarounds; uint8_t messageSpeedSource; uint8_t rssi_source; uint8_t useAdjustments;