Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for the Keyboardio Atreus #36

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hexbyte-de
Copy link

This adds the Keyboardio Atreus as new model to be able to build Menelaus for it. This is necessary, because the Keyboardio Atreus uses 3 pins that aren't provided by the LEO, in contrast to the original design by @technomancy.

This is marked as draft, because I don't know if there is an LED on the PCB that can be used for exception indication. I don't assume there is, but want to make sure before this gets merged. @keyboardio could you help me out with this question, please?

Except from that, everything works as expected, is ready for review and can be tested with this branch: https://git.sr.ht/~hexbyte/menelaus/tree/keyboardio-atreus

This adds a new model for the Keyboardio Atreus. This is neccessary
because it uses pins E2, D7 and D5 of the ATMega32u4, which are not
supported by the Leonardo.
@technomancy
Copy link
Contributor

If this isn't a good fit for inclusion in microscheme, maybe it would be better to call (set! arduino-pins ...) and (set! arduino-ports ...) from menelaus instead?

@hexbyte-de
Copy link
Author

hexbyte-de commented Mar 20, 2021

@technomancy Come to think of it, my changes add an arbitrary mapping between microscheme pin numbers and real pins. Considering @ryansuchocki's comment #21 (comment), setting the ports and pins in menelaus sounds like the cleaner solution.

@ryansuchocki
Copy link
Owner

Apologies for staying quiet so long. Did you work out what to do about the debug LED?

w.r.t. pin mappings, I think the ideal solution would be to add a generic "raw 32u4" model a la #21, and then define Atreus-specific mappings downstream. The advantages of this would be that (A) others can benefit from the raw model and (B) you can update the mappings in future without requiring a ms release.

However, if that can't be done then I'm happy to merge whatever you have.

@hexbyte-de
Copy link
Author

I just received an answer from keyboardio and there is no onboard LED, so I'll remove the draft state.

@technomancy: Setting the pins and port in menelaus also works for me. If it is not too hacky for you, I'm perfectly happy with this solution. Maybe this is how I would have implemented it initially, if I had any prior practical experience with Scheme (or Lisp in general).

A raw mode would be ideal and maybe I find the time to add it someday, but at the moment I can't promise that. I don't have any preference, how we add the pin definitions now. In the end, it comes down to what you both prefer for Microscheme and Menelaus.

@hexbyte-de hexbyte-de marked this pull request as ready for review March 23, 2021 22:09
@technomancy
Copy link
Contributor

I finally got around to loading Microscheme on my Keyboardio Atreus, and this PR works great for that. But I think the "raw 32u4" model makes more sense as a general-purpose thing to ship with micrscheme.

Putting the pin mappings in Menelaus makes plenty of sense, and it would open this up to being used on other non-Arudino chips.

@ryansuchocki ryansuchocki force-pushed the master branch 3 times, most recently from 9ef97ec to 303d62f Compare November 12, 2021 20:10
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.

3 participants