Add missing options
- disable_hardware_pulsing - show_refresh_rate - inverse_colors - hardware_mapping
This commit is contained in:
37
matrix.go
37
matrix.go
@@ -23,6 +23,18 @@ void led_matrix_swap(struct RGBLedMatrix *matrix, struct LedCanvas *offscreen_ca
|
|||||||
|
|
||||||
offscreen_canvas = led_matrix_swap_on_vsync(matrix, offscreen_canvas);
|
offscreen_canvas = led_matrix_swap_on_vsync(matrix, offscreen_canvas);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void set_show_refresh_rate(struct RGBLedMatrixOptions *o, int show_refresh_rate) {
|
||||||
|
o->show_refresh_rate = show_refresh_rate != 0 ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void set_disable_hardware_pulsing(struct RGBLedMatrixOptions *o, int disable_hardware_pulsing) {
|
||||||
|
o->disable_hardware_pulsing = disable_hardware_pulsing != 0 ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void set_inverse_colors(struct RGBLedMatrixOptions *o, int inverse_colors) {
|
||||||
|
o->inverse_colors = inverse_colors != 0 ? 1 : 0;
|
||||||
|
}
|
||||||
*/
|
*/
|
||||||
import "C"
|
import "C"
|
||||||
import (
|
import (
|
||||||
@@ -82,6 +94,9 @@ type HardwareConfig struct {
|
|||||||
|
|
||||||
ShowRefreshRate bool
|
ShowRefreshRate bool
|
||||||
InverseColors bool
|
InverseColors bool
|
||||||
|
|
||||||
|
// Name of GPIO mapping used
|
||||||
|
HardwareMapping string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *HardwareConfig) geometry() (width, height int) {
|
func (c *HardwareConfig) geometry() (width, height int) {
|
||||||
@@ -98,9 +113,25 @@ func (c *HardwareConfig) toC() *C.struct_RGBLedMatrixOptions {
|
|||||||
o.pwm_lsb_nanoseconds = C.int(c.PWMLSBNanoseconds)
|
o.pwm_lsb_nanoseconds = C.int(c.PWMLSBNanoseconds)
|
||||||
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.disable_hardware_pulsing = c.DisableHardwarePulsing
|
o.hardware_mapping = C.CString(c.HardwareMapping)
|
||||||
// o.show_refresh_rate = c.ShowRefreshRate
|
|
||||||
// o.inverse_colors = c.InverseColors
|
if c.ShowRefreshRate == true {
|
||||||
|
C.set_show_refresh_rate(o, C.int(1))
|
||||||
|
} else {
|
||||||
|
C.set_show_refresh_rate(o, C.int(0))
|
||||||
|
}
|
||||||
|
|
||||||
|
if c.DisableHardwarePulsing == true {
|
||||||
|
C.set_disable_hardware_pulsing(o, C.int(1))
|
||||||
|
} else {
|
||||||
|
C.set_disable_hardware_pulsing(o, C.int(0))
|
||||||
|
}
|
||||||
|
|
||||||
|
if c.InverseColors == true {
|
||||||
|
C.set_inverse_colors(o, C.int(1))
|
||||||
|
} else {
|
||||||
|
C.set_inverse_colors(o, C.int(0))
|
||||||
|
}
|
||||||
|
|
||||||
return o
|
return o
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user