Skip to content

Commit

Permalink
Allow set dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorespert committed Dec 27, 2024
1 parent f180541 commit 090eb82
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions controller/device_manager/drivers/factories.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
3 changes: 3 additions & 0 deletions controller/device_manager/drivers/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand All @@ -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()
}
Expand Down

0 comments on commit 090eb82

Please sign in to comment.