Enable incremental frames; add config setting for controlling custom firmware debug flags

This commit is contained in:
James Babcock committed 2026-07-06 12:42:58 -07:00
1 parent 2bc53b8c0e
commit 1533c550b4
7 files changed
+92 -8

No files matched your search

+18 -1
View File
@@ -30,6 +30,7 @@ import {
import {
elevenLabsApiKeySetting,
nightscoutApiTokenSetting,
firmwareDebugFlagsSetting,
nightscoutSiteUrlSetting,
onAnySettingChanged,
rawScreenshotsEnabledSetting,
@@ -188,7 +189,18 @@ class DashboardController {
});
// Settings toggled from the glasses can change what the phone UI shows
// (e.g. the raw-screenshot button), so re-emit the snapshot on any change.
onAnySettingChanged(() => this.emit());
onAnySettingChanged(() => {
this.emit();
// Apply a firmware-debug-flags toggle live while connected (Java dedups).
this.pushFirmwareDebugFlags();
});
}
private pushFirmwareDebugFlags(): void {
if (!this.communicator) return;
void this.communicator
.setFirmwareDebugFlags(firmwareDebugFlagsSetting.get())
.catch(() => {});
}
/**
@@ -346,6 +358,11 @@ class DashboardController {
// phone can sleep normally while they charge.
void this.communicator?.setG2ScreenOn(false).catch(() => {});
}
if (mappedPhase === "connected" && this.phase !== "connected") {
// Push the CFW firmware-debug-flags overlay preference; Java emits the
// mode-7 control message once the dashboard container is warmed up.
this.pushFirmwareDebugFlags();
}
this.setPhase(mappedPhase);
this.setStatus(state.status);
});
+4
View File
@@ -311,6 +311,10 @@ export class FaceclawCommunicatorBridge {
await this.enqueueJavaCall(() => this.communicator.setG2ScreenOn(Boolean(screenOn)));
}
async setFirmwareDebugFlags(enabled: boolean): Promise<void> {
await this.enqueueJavaCall(() => this.communicator.setFirmwareDebugFlags(Boolean(enabled)));
}
async submitDashboardImage(image8bpp: Uint8Array, width: number, height: number, fingerprint: string, paintMs = -1, frameId = 0): Promise<void> {
// Snapshot because the Java call is deferred; the buffer is passed as an
// ArrayBuffer, which NativeScript marshals to a ByteBuffer without the
+7
View File
@@ -267,6 +267,13 @@ export const rawScreenshotsEnabledSetting = new ConfigSettingBoolean({
defaultValue: false,
});
export const firmwareDebugFlagsSetting = new ConfigSettingBoolean({
id: "firmware-debug-flags",
label: "Firmware debug flags",
storageKey: "developer.firmwareDebugFlags",
defaultValue: false,
});
export type VoiceProvider = "onboard" | "elevenlabs";
export const voiceProviderSetting = new ConfigSettingEnum<VoiceProvider>({
+2 -1
View File
@@ -1,5 +1,5 @@
import { dashboardState, TOP_LEFT_MENU_LAYOUT } from "../dashboard";
import { batteryDisplayModeSetting, dashboardSlotIds, elevenLabsApiKeySetting, enumSettingMenuItem, rawScreenshotsEnabledSetting, saveVoiceRecordingsSetting, showSignalStrengthSetting, showAndroidNotificationsSetting, showBatteryIndicatorsSetting, showFaceclawLogoSetting, systemCardNameSetting, textSettingMenuItem, toggleSettingMenuItem, voiceProviderSetting, dashboardSlotSettings, nightscoutSiteUrlSetting, nightscoutApiTokenSetting, screenTimeoutSetting } from "../dashboard-settings";
import { batteryDisplayModeSetting, dashboardSlotIds, elevenLabsApiKeySetting, enumSettingMenuItem, firmwareDebugFlagsSetting, rawScreenshotsEnabledSetting, saveVoiceRecordingsSetting, showSignalStrengthSetting, showAndroidNotificationsSetting, showBatteryIndicatorsSetting, showFaceclawLogoSetting, systemCardNameSetting, textSettingMenuItem, toggleSettingMenuItem, voiceProviderSetting, dashboardSlotSettings, nightscoutSiteUrlSetting, nightscoutApiTokenSetting, screenTimeoutSetting } from "../dashboard-settings";
import { MenuLayer } from "../menu";
export function createSettingsMenuLayer(): MenuLayer {
@@ -47,6 +47,7 @@ function createDeveloperSettingsMenuLayer(): MenuLayer {
[
toggleSettingMenuItem(rawScreenshotsEnabledSetting),
toggleSettingMenuItem(saveVoiceRecordingsSetting),
toggleSettingMenuItem(firmwareDebugFlagsSetting),
],
TOP_LEFT_MENU_LAYOUT,
);