Skip to content
This repository has been archived by the owner on Dec 22, 2022. It is now read-only.

changes to make pp3 user friendly, robust and less segfault #28

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

Conversation

cjacker
Copy link

@cjacker cjacker commented Jun 17, 2022

These changs include:

  • add pic16(l)f1823 to device database and verified.
  • add a help msg
  • add some check to ensure user set up args correctly (at least, '-c' and '-t' are essential args ) and less segfault
  • set a proper init value of sleep time to avoid some 'rx fail' issue.
  • add pp3 makefile for linux and support install it globally.

I try to keep same code-style, but suggest a re-construction of pp3 codes :-)

Cjacker added 10 commits June 16, 2022 21:53

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
…cause a lot of issues, for example, report deviceID as 0x0000, segfault when it can not find correct flashsize and treat it as zero, etc.
@jaromir-sukuba
Copy link
Owner

Hello,
thank you for your major contribution. Please give me some time to digest it.

Regarding the code style: it started as quick hack, where spaghetti is perhaps acceptable - and then grown "organically". To be honest, I'd love to see it reworked into something more sane, but at this time I can't see myself doing this.

Copy link

@TheLizard TheLizard left a comment

Choose a reason for hiding this comment

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

It seems the application also requires an additional argument, which is a filename so it can write it to the PIC programmer.
I believe this can be checked by changing line 360/375 to:
if (argc <= 1 || argv[optind] == NULL)
possibly with an additional error message, or maybe more explicit for programming mode
if (argc <= 1 || (program = 1 && argv[optind] == NULL))

additionally line 1024/1075 can be changed to
char* filename = argv[optind];

and I might also add a check around calling the parse_hex function only when program == 1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants