Compare commits

..

No commits in common. 'main' and 'v1' have entirely different histories.
main ... v1

@ -60,7 +60,7 @@ var DefaultConfig = HardwareConfig{
} }
type RunTimeConfig struct { type RunTimeConfig struct {
Gpio_slowdown int gpio_slowdown int
} }
// HardwareConfig rgb-led-matrix configuration // HardwareConfig rgb-led-matrix configuration
@ -110,7 +110,7 @@ func (c *HardwareConfig) geometry() (width, height int) {
func (c *RunTimeConfig) rt_options() *C.struct_RGBLedRuntimeOptions { func (c *RunTimeConfig) rt_options() *C.struct_RGBLedRuntimeOptions {
rt := &C.struct_RGBLedRuntimeOptions{} rt := &C.struct_RGBLedRuntimeOptions{}
rt.gpio_slowdown = C.int(c.Gpio_slowdown) rt.gpio_slowdown = C.int(c.gpio_slowdown)
return rt return rt
} }

@ -64,40 +64,12 @@ func (tk *ToolKit) PlayAnimation(a Animation) error {
return err return err
} }
} }
if err == io.EOF {
return nil
}
return err
}
func (tk *ToolKit) PlayAnimationUntil(a Animation, notify <-chan bool) error { if err == io.EOF {
var err error
var i image.Image
var n <-chan time.Time
var outerError error
for outerError == nil {
select {
case <-notify:
return nil
default:
i, n, err = a.Next()
if err != nil {
outerError = err
break
}
if err := tk.PlayImageUntil(i, n); err != nil {
return err
}
}
}
if outerError == io.EOF {
return nil return nil
} }
return err return err
} }
// PlayImageUntil draws the given image until is notified to stop // PlayImageUntil draws the given image until is notified to stop

Loading…
Cancel
Save