Skip to content

Start work on on Inky Impression#37

Closed
lawik wants to merge 31 commits intomasterfrom
impression
Closed

Start work on on Inky Impression#37
lawik wants to merge 31 commits intomasterfrom
impression

Conversation

@lawik
Copy link
Collaborator

@lawik lawik commented Oct 10, 2021

No description provided.

{:ok, reset_pid} = gpio.open(pin_mappings[:reset_pin], :output, initial_value: 1)
IO.puts("opening busy pin")
{:ok, busy_pid} = gpio.open(pin_mappings[:busy_pin], :input)
IO.puts("opening SPI device")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to keep the prints in here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left them in because it seemed useful and credo wasn't opposed to it either.

lib/inky.ex Outdated

IO.puts("Seting pixels...")
Inky.set_pixels(Inky.Foo, %{})
end
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a dev function snuck its way in.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, removing this block during my cleanup.

lib/hal/hal.ex Outdated
state :: Inky.IOCommands.State.t()
) ::
:ok | {:error, :device_busy}
io_state() | :ok | {:error, :device_busy}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not cool, hehe... why leak any() from here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, reverting in cleanup.

:yellow => 5,
:orange => 6,
# Not a color, but is used to clear the display
:clean => 7
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably be named clear


@type t() :: %__MODULE__{}

@enforce_keys [:type, :width, :height, :packed_dimensions, :rotation, :accent, :luts]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these are required for one display but not the other, we should consider refactoring things so that we don't force re-usability where it is not required/meaningful (maybe that's exactly what you did here? :D). "False generalisation" only makes things unclear since you don't knew when/if something is required/missing.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've reverted this change too, since these keys can peacefully coexist in the struct the defines the impression display. We're not using packed dimensions because it's redundant/unnecessary, but if someone wants to use them in the future, it'll be possible.

As for luts, it's not used at all for the impression. Not sure we need to define a separate struct+key enforcement just for that though.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good food for thought, though... if the devices are diverting, perhaps our configurations should, too.

One way of dealing with it would be to have a protocol common for all types, for the things that are common to all displays and then have the specific drivers check if it is a value of the correct underlying type at runtime during init. But that might be a bit more than what you signed up for at this point and a bit of over-engineering before we have several displays where the fit is off... thoughts?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds like it might be a worthwhile refactor to open a separate issue for.

defp write_command(state, command, data) do
io_call(state, :handle_command, [command, data])
state
end
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is why we don't copy-paste stuff 😅

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are all being used. Is there an outstanding issue here?

Copy link
Collaborator

@jasonmj jasonmj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got a quick look at the work on this branch. Not a lot to add here, but excited to see progress. Looking forward to getting my impression installed on a pi soon to join in on the fun :)

@jasonmj
Copy link
Collaborator

jasonmj commented Jul 12, 2022

@lawik @nyaray I've worked to clean up this PR and responded on all of the comments. Please get a look and see if there's more you'd like done here before approving to merge. Thanks!

@axelson
Copy link
Collaborator

axelson commented Aug 7, 2023

This can probably be closed in favor of #49

@jasonmj jasonmj closed this Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants