Skip to content

Commit 5708e83

Browse files
add initial debug statements
1 parent faa599e commit 5708e83

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

kernel/src/services/FirmwareService.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ export class FirmwareService {
1717
this.reqFirmwareOptionsGitHub().then((res) => {
1818
this.firmwareOptions = res;
1919
})
20+
21+
// Log the firmware options to the console for debugging.
22+
console.log('Firmware options:', this.firmwareOptions);
2023

2124
if (savedSelection) {
2225
this.selectedFirmwareId = savedSelection;
@@ -28,10 +31,16 @@ export class FirmwareService {
2831
// We'll use this method to fetch the firmware options from GitHub.
2932
// We could alternatively use local files in ../binaries/ so we aren't sending a request to GitHub every time.
3033
private async reqFirmwareOptionsGitHub(): Promise<Record<string, FirmwareOption>> {
34+
// Log that we're in the reqFirmwareOptionsGitHub method.
35+
console.log('Fetching firmware options from GitHub...');
36+
3137
const releases = await fetch('https://api.github.com/repos/sparkfun/micropython/releases', {
3238
method: 'GET'
3339
});
3440

41+
// Log the response for debugging.
42+
console.log('Releases response:', releases);
43+
3544
if (!releases.ok) {
3645
throw new Error(`Failed to fetch releases: ${releases.status} ${releases.statusText}`);
3746
}
@@ -47,6 +56,9 @@ export class FirmwareService {
4756
const latestRelease = releasesData[0];
4857
if (latestRelease && latestRelease.assets) {
4958
latestRelease.assets.forEach((asset: any) => {
59+
// Log the asset for debugging.
60+
console.log('Asset:', asset);
61+
5062
// We should make the name the full name of the asset but the key the firmwareId (the board name in lowercase with dashes and an optional "m" prefix for minimal).
5163
const firmwareName = asset.name;
5264
var firmwareId = firmwareName.replace(/\.uf2|\.zip/g, '').toLowerCase().replace(/_/g, '-');

0 commit comments

Comments
 (0)