Skip to content

Commit

Permalink
add flex support
Browse files Browse the repository at this point in the history
  • Loading branch information
tdejoigny-ledger committed Apr 4, 2024
1 parent c42bd42 commit 3689b77
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.5.3]

### Added

* Flex device support.

## [0.5.2]

### Fixed
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

The extension uses Ledger's own [Docker image](https://github.com/LedgerHQ/ledger-app-builder/blob/master/dev-tools/Dockerfile) to allow developers to setup a build and test environment in a few minutes.

* Build your app for all Ledger devices : Nano S, Nano S Plus, Nano X, Stax.
* Build your app for all Ledger devices : Nano S, Nano S Plus, Nano X, Stax and Flex.
* Supports C and Rust apps.
* Stay up to date with the latest SDK.
* Run tests on the device emulator ([Speculos](https://github.com/LedgerHQ/speculos)) or on a real device.
Expand Down Expand Up @@ -63,6 +63,10 @@ This extension contributes the following settings:

## Release Notes

## [0.5.3]

* Flex device support.

## 0.5.2

* Fix plugin support on Windows : clone and build of test dependencies were not working properly.
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ledger-dev-tools",
"displayName": "Ledger Dev Tools",
"description": "Tools to accelerate development of apps for Ledger devices.",
"version": "0.5.2",
"version": "0.5.3",
"publisher": "LedgerHQ",
"license": "Apache",
"icon": "resources/ledger-square.png",
Expand Down Expand Up @@ -186,7 +186,8 @@
"Nano S",
"Nano S Plus",
"Nano X",
"Stax"
"Stax",
"Flex"
],
"markdownDescription": "Select the default Device"
},
Expand Down
4 changes: 3 additions & 1 deletion src/appSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export function findAppInFolder(folderUri: vscode.Uri): App | undefined {
let appLanguage: AppLanguage = "C";
let testsDir = undefined;
let packageName = undefined;
let compatibleDevices: LedgerDevice[] = ["Nano S", "Nano S Plus", "Nano X", "Stax"];
let compatibleDevices: LedgerDevice[] = ["Nano S", "Nano S Plus", "Nano X", "Stax", "Flex"];
let testsUseCases = undefined;
let buildUseCases = undefined;
let buildDirPath = "./";
Expand Down Expand Up @@ -331,6 +331,8 @@ function manifestDevicesToLedgerDevices(manifestDevices: string): LedgerDevice[]
return "Nano S Plus";
case "stax":
return "Stax";
case "flex":
return "Flex";
default:
throw new Error("Invalid device in manifest : " + device);
}
Expand Down
8 changes: 6 additions & 2 deletions src/targetSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { TreeDataProvider } from "./treeView";
import { getSelectedApp } from "./appSelector";

// Define valid devices
const devices = ["Nano S", "Nano S Plus", "Nano X", "Stax"] as const;
const devices = ["Nano S", "Nano S Plus", "Nano X", "Stax", "Flex"] as const;

const specialAllDevice = "All";

Expand All @@ -14,32 +14,36 @@ type SpecialAllDevice = typeof specialAllDevice;
// Define the LedgerDevice type
export type LedgerDevice = (typeof devices)[number];

const targetsArray: LedgerDevice[] = ["Nano S", "Nano S Plus", "Nano X", "Stax"];
const targetsArray: LedgerDevice[] = ["Nano S", "Nano S Plus", "Nano X", "Stax", "Flex"];

const targetSDKs: Record<string, string> = {
[targetsArray[0]]: "$NANOS_SDK",
[targetsArray[1]]: "$NANOSP_SDK",
[targetsArray[2]]: "$NANOX_SDK",
[targetsArray[3]]: "$STAX_SDK",
[targetsArray[4]]: "$FLEX_SDK",
};
const speculosModels: Record<string, string> = {
[targetsArray[0]]: "nanos",
[targetsArray[1]]: "nanosp",
[targetsArray[2]]: "nanox",
[targetsArray[3]]: "stax",
[targetsArray[4]]: "flex",
};
const sdkModels: Record<string, string> = {
[targetsArray[0]]: "nanos",
[targetsArray[1]]: "nanos2",
[targetsArray[2]]: "nanox",
[targetsArray[3]]: "stax",
[targetsArray[4]]: "flex",
};

const targetIds: Record<string, string> = {
[targetsArray[0]]: "0x31100004", // ST31
[targetsArray[1]]: "0x33100004", // ST33K1M5
[targetsArray[2]]: "0x33000004", // ST33
[targetsArray[3]]: "0x33200004", // ST33K1M5
[targetsArray[4]]: "0x33200004", // ST33K1M5
};

export class TargetSelector {
Expand Down

0 comments on commit 3689b77

Please sign in to comment.