From 090eb820aea831b4c42445cf4eb528e2a780f066 Mon Sep 17 00:00:00 2001 From: Hector Espert Date: Fri, 27 Dec 2024 19:29:39 +0100 Subject: [PATCH] Allow set dev mode --- controller/device_manager/drivers/factories.go | 3 +++ controller/device_manager/drivers/main.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/controller/device_manager/drivers/factories.go b/controller/device_manager/drivers/factories.go index da5534aa8..b06b421b4 100644 --- a/controller/device_manager/drivers/factories.go +++ b/controller/device_manager/drivers/factories.go @@ -67,6 +67,9 @@ func (d *Drivers) loadRpi() error { if d.pwm_freq > 0 { piDriver.Parameters["Frequency"] = d.pwm_freq } + if d.devMode { + piDriver.Parameters["Dev Mode"] = true + } return d.register(piDriver, factory) } diff --git a/controller/device_manager/drivers/main.go b/controller/device_manager/drivers/main.go index ae8d7a729..021f35718 100644 --- a/controller/device_manager/drivers/main.go +++ b/controller/device_manager/drivers/main.go @@ -36,6 +36,7 @@ type Drivers struct { sync.Mutex drivers map[string]hal.Driver store storage.Store + devMode bool pwm_freq int bus i2c.Bus t telemetry.Telemetry @@ -49,6 +50,7 @@ func NewDrivers(s settings.Settings, bus i2c.Bus, store storage.Store, t telemet d := &Drivers{ drivers: make(map[string]hal.Driver), store: store, + devMode: false, pwm_freq: s.RPI_PWMFreq, bus: bus, t: t, @@ -59,6 +61,7 @@ func NewDrivers(s settings.Settings, bus i2c.Bus, store storage.Store, t telemet } if s.Capabilities.DevMode { d.isRaspberryPi = true + d.devMode = true } return d, d.loadAll() }