Merge pull request #1 from brendanporter/gpio_slowdown

Gpio slowdown
pull/13/head
Brendan Porter 6 years ago committed by GitHub
commit 8eec508d5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -56,6 +56,7 @@ var DefaultConfig = HardwareConfig{
PWMLSBNanoseconds: 130, PWMLSBNanoseconds: 130,
Brightness: 100, Brightness: 100,
ScanMode: Progressive, ScanMode: Progressive,
GPIOSlowdown: 1,
} }
// HardwareConfig rgb-led-matrix configuration // HardwareConfig rgb-led-matrix configuration
@ -95,6 +96,9 @@ type HardwareConfig struct {
ShowRefreshRate bool ShowRefreshRate bool
InverseColors bool InverseColors bool
// Control speed of GPIO updates. Valid range is 0..3
GPIOSlowdown int
// Name of GPIO mapping used // Name of GPIO mapping used
HardwareMapping string HardwareMapping string
} }
@ -114,6 +118,7 @@ func (c *HardwareConfig) toC() *C.struct_RGBLedMatrixOptions {
o.brightness = C.int(c.Brightness) o.brightness = C.int(c.Brightness)
o.scan_mode = C.int(c.ScanMode) o.scan_mode = C.int(c.ScanMode)
o.hardware_mapping = C.CString(c.HardwareMapping) o.hardware_mapping = C.CString(c.HardwareMapping)
o.gpio_slowdown = C.int(c.GPIOSlowdown)
if c.ShowRefreshRate == true { if c.ShowRefreshRate == true {
C.set_show_refresh_rate(o, C.int(1)) C.set_show_refresh_rate(o, C.int(1))

Loading…
Cancel
Save