From 166323618427a900ce09ca8fd43eb60226f69d6c Mon Sep 17 00:00:00 2001 From: David Montero Date: Tue, 26 May 2026 16:57:37 +0200 Subject: [PATCH] debug: trace onSerialData setter --- frontend/src/simulation/AVRSimulator.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/simulation/AVRSimulator.ts b/frontend/src/simulation/AVRSimulator.ts index 5a366c50..5b261a6e 100644 --- a/frontend/src/simulation/AVRSimulator.ts +++ b/frontend/src/simulation/AVRSimulator.ts @@ -301,7 +301,13 @@ export class AVRSimulator { private scheduledPinChanges: Array<{ cycle: number; pin: number; state: boolean }> = []; /** Serial output buffer — subscribers receive each byte or line */ - public onSerialData: ((char: string) => void) | null = null; + private _onSerialData: ((char: string) => void) | null = null; + public get onSerialData(): ((char: string) => void) | null { return this._onSerialData; } + public set onSerialData(v: ((char: string) => void) | null) { + const who = new Error().stack?.split('\n').slice(1, 6).join(' | '); + console.log('[AVR-DBG] onSerialData SET (fn?', typeof v === 'function', ') from', who); + this._onSerialData = v; + } /** Fires whenever the sketch changes Serial baud rate (Serial.begin) */ public onBaudRateChange: ((baudRate: number) => void) | null = null; /**