Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
periph.io/x/conn/v3 v3.7.2
periph.io/x/d2xx v0.1.1
periph.io/x/devices/v3 v3.7.4
periph.io/x/host/v3 v3.8.3
periph.io/x/host/v3 v3.8.5
)

require github.com/jonboulle/clockwork v0.5.0 // indirect
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ periph.io/x/d2xx v0.1.1 h1:LHp+u+qAWLB5THrTT/AzyjdvfUhllvDF5wBJP7uvn+U=
periph.io/x/d2xx v0.1.1/go.mod h1:rLM321G11Fc14Pp088khBkmXb70Pxx/kCPaIK7uRUBc=
periph.io/x/devices/v3 v3.7.4 h1:g9CGKTtiXS9iyDFDba4sr9pYde4dy+ZCKRPuKpKJdKo=
periph.io/x/devices/v3 v3.7.4/go.mod h1:FqFG9RotW2aCkfIlAes3qxziwgjRTncTMS5cSOcizNg=
periph.io/x/host/v3 v3.8.3 h1:v90ozCFDWgEyfNElZ+JnOvq0jAdW0vmgjCUy8dYXDds=
periph.io/x/host/v3 v3.8.3/go.mod h1:uKrIpfXjELwHkwGBNe6aos//XiQ/3uxDa1P2BmLV6Ok=
periph.io/x/host/v3 v3.8.5 h1:g4g5xE1XZtDiGl1UAJaUur1aT7uNiFLMkyMEiZ7IHII=
periph.io/x/host/v3 v3.8.5/go.mod h1:hPq8dISZIc+UNfWoRj+bPH3XEBQqJPdFdx218W92mdc=
36 changes: 23 additions & 13 deletions inky/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
func mainImpl() error {
spiPort := flag.String("spi", "SPI0.0", "Name or number of SPI port to open")
path := flag.String("image", "", "Path to a png file to display on the inky")
dcPin := flag.String("dc", "22", "Inky DC Pin")
resetPin := flag.String("reset", "27", "Inky Reset Pin")
busyPin := flag.String("busy", "17", "Inky Busy Pin")
model := inky.PHAT
flag.Var(&model, "model", "Inky model (PHAT or WHAT)")
modelColor := inky.Red
flag.Var(&modelColor, "model-color", "Inky model color (black, red or yellow)")
borderColor := inky.Black
flag.Var(&borderColor, "border-color", "Border color (black, white, red or yellow)")
dcPin := flag.String("dc", "GPIO22", "Inky DC Pin")
resetPin := flag.String("reset", "GPIO27", "Inky Reset Pin")
busyPin := flag.String("busy", "GPIO17", "Inky Busy Pin")
model := inky.IMPRESSION73
flag.Var(&model, "model", "Inky model (PHAT, PHAT2, WHAT, IMPRESSION4, IMPRESSION57, or IMPRESSION73)")
modelColor := inky.Multi
flag.Var(&modelColor, "model-color", "Inky model color (multi, black, red or yellow)")
borderColor := inky.Red
flag.Var(&borderColor, "border-color", "Border color (multi, black, white, red or yellow)")

Check warning on line 33 in inky/main.go

View check run for this annotation

Codecov / codecov/patch

inky/main.go#L25-L33

Added lines #L25 - L33 were not covered by tests
flag.Parse()

// Open and decode the image.
Expand Down Expand Up @@ -73,16 +73,26 @@
}

log.Printf("Creating inky...")
dev, err := inky.New(b, dc, reset, busy, &inky.Opts{
opts := &inky.Opts{

Check warning on line 76 in inky/main.go

View check run for this annotation

Codecov / codecov/patch

inky/main.go#L76

Added line #L76 was not covered by tests
Model: model,
ModelColor: modelColor,
BorderColor: borderColor,
})
if err != nil {
return err
}

log.Printf("Drawing image...")

if model <= inky.PHAT2 {
dev, eInky := inky.New(b, dc, reset, busy, opts)
if eInky != nil {
return eInky
}
return dev.Draw(img.Bounds(), img, image.Point{})

Check warning on line 89 in inky/main.go

View check run for this annotation

Codecov / codecov/patch

inky/main.go#L83-L89

Added lines #L83 - L89 were not covered by tests
}

dev, err := inky.NewImpression(b, dc, reset, busy, opts)
if err != nil {
return err
}

Check warning on line 95 in inky/main.go

View check run for this annotation

Codecov / codecov/patch

inky/main.go#L92-L95

Added lines #L92 - L95 were not covered by tests
return dev.Draw(img.Bounds(), img, image.Point{})
}

Expand Down