-
-
Notifications
You must be signed in to change notification settings - Fork 936
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added new DSHOT debug modes #3262
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -12,7 +12,7 @@ import FC from "../fc"; | |||||||||||||||||||||||||||||||||||||||||||
import MSP from "../msp"; | ||||||||||||||||||||||||||||||||||||||||||||
import { mixerList } from "../model"; | ||||||||||||||||||||||||||||||||||||||||||||
import MSPCodes from "../msp/MSPCodes"; | ||||||||||||||||||||||||||||||||||||||||||||
import { API_VERSION_1_42, API_VERSION_1_44 } from "../data_storage"; | ||||||||||||||||||||||||||||||||||||||||||||
import { API_VERSION_1_42, API_VERSION_1_44, API_VERSION_1_46 } from "../data_storage"; | ||||||||||||||||||||||||||||||||||||||||||||
import EscProtocols from "../utils/EscProtocols"; | ||||||||||||||||||||||||||||||||||||||||||||
import { updateTabList } from "../utils/updateTabList"; | ||||||||||||||||||||||||||||||||||||||||||||
import { isInt, getMixerImageSrc } from "../utils/common"; | ||||||||||||||||||||||||||||||||||||||||||||
|
@@ -22,6 +22,7 @@ import $ from 'jquery'; | |||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
const motors = { | ||||||||||||||||||||||||||||||||||||||||||||
previousDshotBidir: null, | ||||||||||||||||||||||||||||||||||||||||||||
previousDshotEdt: null, | ||||||||||||||||||||||||||||||||||||||||||||
previousFilterDynQ: null, | ||||||||||||||||||||||||||||||||||||||||||||
previousFilterDynCount: null, | ||||||||||||||||||||||||||||||||||||||||||||
analyticsChanges: {}, | ||||||||||||||||||||||||||||||||||||||||||||
|
@@ -279,6 +280,7 @@ motors.initialize = async function (callback) { | |||||||||||||||||||||||||||||||||||||||||||
feature12: FC.FEATURE_CONFIG.features.isEnabled('3D'), | ||||||||||||||||||||||||||||||||||||||||||||
feature27: FC.FEATURE_CONFIG.features.isEnabled('ESC_SENSOR'), | ||||||||||||||||||||||||||||||||||||||||||||
dshotBidir: FC.MOTOR_CONFIG.use_dshot_telemetry, | ||||||||||||||||||||||||||||||||||||||||||||
dshotEdt: FC.MOTOR_CONFIG.use_dshot_edt, | ||||||||||||||||||||||||||||||||||||||||||||
motorPoles: FC.MOTOR_CONFIG.motor_poles, | ||||||||||||||||||||||||||||||||||||||||||||
digitalIdlePercent: FC.PID_ADVANCED_CONFIG.digitalIdlePercent, | ||||||||||||||||||||||||||||||||||||||||||||
idleMinRpm: FC.ADVANCED_TUNING.idleMinRpm, | ||||||||||||||||||||||||||||||||||||||||||||
|
@@ -700,6 +702,7 @@ motors.initialize = async function (callback) { | |||||||||||||||||||||||||||||||||||||||||||
dshotBidirElement.prop('checked', FC.MOTOR_CONFIG.use_dshot_telemetry).trigger("change"); | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
self.previousDshotBidir = FC.MOTOR_CONFIG.use_dshot_telemetry; | ||||||||||||||||||||||||||||||||||||||||||||
self.previousDshotEdt = FC.MOTOR_CONFIG.use_dshot_edt; | ||||||||||||||||||||||||||||||||||||||||||||
self.previousFilterDynQ = FC.FILTER_CONFIG.dyn_notch_q; | ||||||||||||||||||||||||||||||||||||||||||||
self.previousFilterDynCount = FC.FILTER_CONFIG.dyn_notch_count; | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
|
@@ -708,6 +711,12 @@ motors.initialize = async function (callback) { | |||||||||||||||||||||||||||||||||||||||||||
const newValue = (value !== FC.MOTOR_CONFIG.use_dshot_telemetry) ? 'On' : 'Off'; | ||||||||||||||||||||||||||||||||||||||||||||
self.analyticsChanges['BidirectionalDshot'] = newValue; | ||||||||||||||||||||||||||||||||||||||||||||
FC.MOTOR_CONFIG.use_dshot_telemetry = value; | ||||||||||||||||||||||||||||||||||||||||||||
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_46) && !value) { | ||||||||||||||||||||||||||||||||||||||||||||
const dshotEdtElement = $('input[id="dshotEdt"]'); | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
FC.MOTOR_CONFIG.use_dshot_edt = value; | ||||||||||||||||||||||||||||||||||||||||||||
dshotEdtElement.prop('checked', FC.MOTOR_CONFIG.use_dshot_edt).trigger("change"); | ||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44)) { | ||||||||||||||||||||||||||||||||||||||||||||
const rpmFilterIsDisabled = FC.FILTER_CONFIG.gyro_rpm_notch_harmonics === 0; | ||||||||||||||||||||||||||||||||||||||||||||
|
@@ -742,6 +751,19 @@ motors.initialize = async function (callback) { | |||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_46)) { | ||||||||||||||||||||||||||||||||||||||||||||
const dshotEdtElement = $('input[id="dshotEdt"]'); | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
dshotEdtElement.prop('checked', FC.MOTOR_CONFIG.use_dshot_edt).trigger("change"); | ||||||||||||||||||||||||||||||||||||||||||||
dshotEdtElement.on("change", function () { | ||||||||||||||||||||||||||||||||||||||||||||
const value = dshotEdtElement.is(':checked'); | ||||||||||||||||||||||||||||||||||||||||||||
const newValue = (value !== FC.MOTOR_CONFIG.use_dshot_edt) ? 'On' : 'Off'; | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
self.analyticsChanges['DshotEdt'] = newValue; | ||||||||||||||||||||||||||||||||||||||||||||
FC.MOTOR_CONFIG.use_dshot_edt = value; | ||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+755
to
+764
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure about the code style here. Better to use Also, not sure what triggering Something like the following is a bit more streamlined/usual in js land
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
$('input[name="motorPoles"]').val(FC.MOTOR_CONFIG.motor_poles); | ||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
|
@@ -780,14 +802,20 @@ motors.initialize = async function (callback) { | |||||||||||||||||||||||||||||||||||||||||||
$('div.digitalIdlePercent').hide(); | ||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
$('.escSensor').toggle(protocolConfigured && digitalProtocol); | ||||||||||||||||||||||||||||||||||||||||||||
$('.escSensor').toggle( | ||||||||||||||||||||||||||||||||||||||||||||
protocolConfigured && digitalProtocol && ( | ||||||||||||||||||||||||||||||||||||||||||||
semver.lt(FC.CONFIG.apiVersion, API_VERSION_1_46) || | ||||||||||||||||||||||||||||||||||||||||||||
semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_46) && !FC.MOTOR_CONFIG.use_dshot_edt)); | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
$('div.checkboxDshotBidir').toggle(protocolConfigured && semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_42) && digitalProtocol); | ||||||||||||||||||||||||||||||||||||||||||||
$('div.motorPoles').toggle(protocolConfigured && rpmFeaturesVisible && semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_42)); | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
$('.escMotorStop').toggle(protocolConfigured); | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
$('#escProtocolDisabled').toggle(!protocolConfigured); | ||||||||||||||||||||||||||||||||||||||||||||
$('.checkboxDshotEdt').toggle( | ||||||||||||||||||||||||||||||||||||||||||||
protocolConfigured && digitalProtocol && dshotBidirElement.is(':checked') && | ||||||||||||||||||||||||||||||||||||||||||||
!$("input[name='ESC_SENSOR']").is(':checked') && semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_46)); | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
//trigger change unsyncedPWMSwitch to show/hide Motor PWM freq input | ||||||||||||||||||||||||||||||||||||||||||||
unsyncedPWMSwitchElement.trigger("change"); | ||||||||||||||||||||||||||||||||||||||||||||
|
@@ -809,6 +837,11 @@ motors.initialize = async function (callback) { | |||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
//trigger change dshotBidir and ESC_SENSOR to show/hide Motor Poles tab | ||||||||||||||||||||||||||||||||||||||||||||
dshotBidirElement.change(updateVisibility).trigger("change"); | ||||||||||||||||||||||||||||||||||||||||||||
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_46)) { | ||||||||||||||||||||||||||||||||||||||||||||
const dshotEdtElement = $('input[id="dshotEdt"]'); | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
dshotEdtElement.change(updateVisibility).trigger("change"); | ||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||
$("input[name='ESC_SENSOR']").on("change", updateVisibility).trigger("change"); | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
// fill throttle | ||||||||||||||||||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,8 +89,12 @@ | |
<div class="number checkboxDshotBidir"> | ||
<div style="float: left; height: 20px; margin-right: 14px; margin-left: 3px;"> | ||
<input type="checkbox" id="dshotBidir" class="toggle" /> | ||
<span class="freelabel" i18n="configurationDshotBidir"></span> | ||
</div> | ||
<div style="float: left; height: 20px; margin-right: 14px; margin-left: 3px;" class="checkboxDshotEdt"> | ||
<input type="checkbox" id="dshotEdt" class="toggle" /> | ||
<span class="freelabel" id="dshotEdtLabel" i18n="configurationDshotEdt"></span> | ||
Comment on lines
+94
to
+96
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ooof, these floats look painful 🫠 But probably better for style consistency. More of a note to self/team 🙈 |
||
</div> | ||
<span class="freelabel" i18n="configurationDshotBidir"></span> | ||
<div class="helpicon cf_tip" i18n_title="configurationDshotBidirHelp"></div> | ||
</div> | ||
<div class="number motorPoles"> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@haslinghuis , beside 1_47, what are any suggestions about this line considering some old semvers were removed and considering PWA?
is this line needed at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API_VERSION_1_47
needs to be added instead.