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

make scratchmonkey an own programmer type that can use status LEDs #1515

Closed
wants to merge 1 commit into from

Conversation

Ho-Ro
Copy link
Contributor

@Ho-Ro Ho-Ro commented Oct 12, 2023

All 4 status LEDs can be activated during programming and verifying process. Due to a probable issue #1514 from avrdude the pgm_led is only active during chip erase, but not during flash or eeprom write.

no VTARG, VAREF, FOSC handling

Signed-off-by: Martin <[email protected]>
@mcuee mcuee added bug Something isn't working enhancement New feature or request and removed bug Something isn't working labels Oct 12, 2023
@stefanrueger
Copy link
Collaborator

@Ho-Ro Martin, thanks for the PR!

I have had a quick look, and think we need changes

  • Changes to .gitignore should not be part of this PR; if you want to change .gitignore I suggest a separate PR
  • Formatting changes are discouraged unless the lines are touched anyway to keep PRs crisp, clean and focussed
  • Introducing a new programmer type should only happen when a new programming paradigm is used; this PR introduces three new types, but all that happens is a (minor) extension of STK500v2 to support LEDs; in order to avoid a proliferation of programmer types I suggest not introducing a new programmer type
  • Static variables are discouraged as in the long run we want libavrdude to become a re-entrant library; I realise you need to keep the state of the LEDS (b/c the scratchmonkey LED command expects the status of all LEDs) but that should happen in allocated private programmer data per programmer; that way if an application (different from AVRDUDE) wants to serve three connected programmers two of which are scratchmonkeys that application can use libavrdude and open two scratchmonkeys and have two separate LED state variables

I have no doubt that this PR works for you, but I think it needs a major rewrite so it fits in with the AVRDUDE philosophy. Let me think about the best way to add LED functions to STK500v2 during runtime once the programmer has identified itself as scratchmonkey.

@stefanrueger
Copy link
Collaborator

Let me think about the best way to add LED functions to STK500v2

@Ho-Ro Please check out PR #1517 and see whether that works for you

@Ho-Ro
Copy link
Contributor Author

Ho-Ro commented Oct 13, 2023

@Ho-Ro Martin, thanks for the PR!
I have had a quick look, and think we need changes

That was the reason I didn't wanted to present the PR unless asked by @mcuee in #1514

Looks like an avrdude bug to me. Can you create a PR to address this?

So I just provided my private SMo development branch, even if I knew that it is not mature enough for production. It is just a proof of concept working on my desk with my nano equipped with 4 LEDs runing SMo software. And when the LEDs are in place they should light accordingly. :)

@stefanrueger Thx for your fast response - I will check immediately.
EDIT: works for me, thank you. I will close this failed PR. In the meantime I thought about a solution like extra_features = HAS_STATUS_LEDS for stk500v2, but your approach is perfect.

@Ho-Ro
Copy link
Contributor Author

Ho-Ro commented Oct 13, 2023

Closed due to #1517

@Ho-Ro Ho-Ro closed this Oct 13, 2023
@stefanrueger
Copy link
Collaborator

@Ho-Ro Thanks for reaching out and for providing a PR that explains in C rather than prose how AVRDUDE might be improved. So that has been useful. Yes, extra_features would probably have worked as well (didn't think of this).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants