fixed saved peripherals for a new project

This commit is contained in:
2024-12-29 21:22:53 +01:00
parent b69097e2a4
commit 556f24991e
12 changed files with 264 additions and 169 deletions

View File

@@ -32,8 +32,12 @@ func NewFTDIDriver() *FTDIDriver {
}
}
//go:embed third-party/ftdi/detectFTDI.exe
var findFTDI []byte
// Initialize initializes the FTDI driver
func (d *FTDIDriver) Initialize() error {
// Check platform
if goRuntime.GOOS != "windows" {
log.Error().Str("file", "FTDIDriver").Str("platform", goRuntime.GOOS).Msg("FTDI driver not compatible with your platform")
return fmt.Errorf("<!> The FTDI driver is not compatible with your platform yet (%s)", goRuntime.GOOS)
@@ -59,9 +63,6 @@ func (d *FTDIDriver) GetPeripheral(peripheralID string) (Peripheral, bool) {
return peripheral, true
}
//go:embed third-party/ftdi/detectFTDI.exe
var findFTDI []byte
// Scan scans the FTDI peripherals
func (d *FTDIDriver) Scan(ctx context.Context) error {
log.Trace().Str("file", "FTDIDriver").Msg("FTDI scan triggered")