Skip to content
Merged
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
6 changes: 5 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1516,7 +1516,11 @@ <h5 class="modal-title-revision"></h5>
<!-- list generated here -->
</select>
</td>
<td name='gyro_hardware_lpf'>
<td name='gyro_enabled_bitmask'>
<label>Gyro enable mask</label>
<input type="text" step="1" min="1" max="255" />
</td>
<td name='gyro_hardware_lpf'>
<label>Hardware gyro LPF</label>
<select>
<!-- list generated here -->
Expand Down
2 changes: 2 additions & 0 deletions src/flightlog_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ export function FlightLogParser(logData) {
fields_disabled_mask: null,
vbat_sag_compensation: null,
gyro_to_use: null,
gyro_enabled_bitmask: null,
dynamic_idle_min_rpm: null,
motor_poles: 1,
ff_transition: null,
Expand Down Expand Up @@ -743,6 +744,7 @@ export function FlightLogParser(logData) {
case "fields_disabled_mask":
case "motor_pwm_protocol":
case "gyro_to_use":
case "gyro_enabled_bitmask":
case "dynamic_idle_min_rpm":
case "dyn_idle_p_gain":
case "dyn_idle_i_gain":
Expand Down
28 changes: 28 additions & 0 deletions src/header_dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,12 @@ export function HeaderDialog(dialog, onSave) {
name: "gyro_to_use",
type: FIRMWARE_TYPE_BETAFLIGHT,
min: "4.3.0",
max: "4.5.9",
},
{
name: "gyro_enabled_bitmask",
type: FIRMWARE_TYPE_BETAFLIGHT,
min: "2025.12.0",
max: "9999.9.9",
},
{
Expand Down Expand Up @@ -873,6 +879,27 @@ export function HeaderDialog(dialog, onSave) {
);
}

function setBitmaskParameter(name, data, totalBits = 8) {
let parameterElem = $(`.parameter td[name="${name}"]`);
let nameElem = $("input", parameterElem);
if (data != null) {
// Convert number to binary string with leading zeros
const binaryString = data.toString(2).padStart(totalBits, '0');
// Display as "3 (0b00000011)" format
const displayValue = `${data} (${binaryString})`;
nameElem.val(displayValue);
nameElem.attr("readonly", true); // Make it readonly since it shows formatted bitmask
parameterElem.attr("title", `Bitmask value: ${data} (binary: ${binaryString})`);
parameterElem.removeClass("missing");
} else {
parameterElem.addClass("missing");
}
parameterElem.css(
"display",
isParameterValid(name) ? "table-cell" : "none"
);
}

function setCheckbox(name, data) {
let parameterElem = $(`.static-features td[name="${name}"]`);
let nameElem = $("input", parameterElem);
Expand Down Expand Up @@ -1938,6 +1965,7 @@ export function HeaderDialog(dialog, onSave) {
renderSelect("baro_hardware", sysConfig.baro_hardware, BARO_HARDWARE);
renderSelect("mag_hardware", sysConfig.mag_hardware, MAG_HARDWARE);
renderSelect("gyro_to_use", sysConfig.gyro_to_use, GYRO_TO_USE);
setBitmaskParameter("gyro_enabled_bitmask", sysConfig.gyro_enabled_bitmask, 8);
setParameter("motor_poles", sysConfig.motor_poles, 0);

/* Booleans */
Expand Down