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
leonardo directly maps pins D0-4 to channels 0-4 #28
Conversation
I would like to also map D6 to CH5, but it is used for "DEBUG_ENABLE" on some platforms. The ifdefs on lines 187-195 are responsible for enabling/disabling D6; I'm not sure how to enable it cleanly without messing up other platforms. For the time being, 5 well-ordered channels should be good enough. |
Oh! I feel a little dirty, but I didn't add channel definitions. Those particular pins default to read mode, so all that is needed is the atmega channel pin. I'm pretty new to this stuff, so I'm not sure that's kosher. Let me know if that's a problem! |
I'd also like to remove the USE_PORTD ifdefs and have a USE_PORTD mapping to reduce code complexity. After that, I'm thinking of looking at the trigger code :) |
I'm not sure how the remap function is reducing code complexity since it is much more complex than a few #ifdef operations, but I can see the benefit for PORTD which doesn't have consecutive pins. I'm not sure I got all the stuff on the right correct as I was guessing as to what it meant, but I think I got it. |
The remap should be putting everything in a line on the board - Channel 0 in LogicSniffer is mapped to the screen-printed Digital 0 pin for the Leonardo. I don't exactly understand the internal arduino pin mapping terminology, sorry if what I'm saying is confusing.
DX = pin number printed on pcb The remap: {3,1,6,6,0,0,0,0} I've added a debug menu option to run a 'remap' operation so you can see how channels are shifted around (not in this pull request, though). By code complexity, I'm trying to say that because remap_channels can do everything the USE_PORTD code does (at least inside of functions), it doesn't make sense to have both in there. On the Leonardo it takes .02-.03 seconds longer to run, and it makes it easier to use... if you want it to be faster, I can look into that, but it might become harder to read. I've updated my code comments to hopefully be easier to follow. |
Look at this mapping and see how it compares: https://www.arduino.cc/en/Hacking/PinMapping32u4 |
The way you have written that down makes sense to me? so that pin should be shifted 6. |
Can you please rebase against the current repo and the logic_analyzer_leonardo sub-directory? I'm splitting into support by board as the #ifdef stuff is too involved for more / newer boards. I may actually want to split 168/328 and Uno/Mega style AVRs also. |
No description provided.