Skip to content

Commit

Permalink
update peripheral values on stopped event
Browse files Browse the repository at this point in the history
  • Loading branch information
brianignacio5 committed Apr 8, 2024
1 parent cc16bcf commit b9b7001
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1417,6 +1417,23 @@ export async function activate(context: vscode.ExtensionContext) {
}
});

vscode.debug.registerDebugAdapterTrackerFactory("gdbtarget", {
createDebugAdapterTracker(session: vscode.DebugSession) {
return {
onDidSendMessage: async (m) => {
console.log(m);
if (m && m.type === "event" && m.event === "stopped") {
const peripherals = await peripheralTreeProvider.getChildren();
for (const p of peripherals) {
p.getPeripheral().updateData();
}
peripheralTreeProvider.refresh();
}
},
};
},
});

vscode.debug.onDidTerminateDebugSession((session) => {
peripheralTreeProvider.debugSessionTerminated(session);
});
Expand Down

0 comments on commit b9b7001

Please sign in to comment.