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

Wip/hughsie/atmel flip #292

Merged
merged 10 commits into from
Oct 31, 2017
Merged

Wip/hughsie/atmel flip #292

merged 10 commits into from
Oct 31, 2017

Conversation

hughsie
Copy link
Member

@hughsie hughsie commented Oct 27, 2017

No description provided.

@hughsie hughsie requested review from gicmo and superm1 October 27, 2017 16:28
DfuTargetTransferFlags flags,
GCancellable *cancellable,
GError **error);
};
Copy link
Member

Choose a reason for hiding this comment

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

This may not be a large issue, and intended but i'll mention in case it's an oversight.
You previously had padding for 8 reservations but only added 6 function assignments.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, but I removed the padding as we're not installing the library I don't care about ABI much. If you're more comfortable I can remove all the class padding in a separate commit.

Copy link
Member

Choose a reason for hiding this comment

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

No worry, I think it's fine as is. just wanted to make sure you were aware. Since it's internal private ABI probably not a big deal.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've removed this manually in master.

@@ -689,6 +710,10 @@ dfu_device_set_quirks (DfuDevice *device)
}
}

/* Atmel bootloader */
if (vid == 0x03eb)
Copy link
Member

Choose a reason for hiding this comment

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

It would be good to put this into a #define for the vendor instead of comment.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've avoided this in the set_quirks() function as we only need it once, and I'm not sure it adds to the readability.

Copy link
Member

Choose a reason for hiding this comment

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

Well maybe not now, but i was thinking if the quirks grows a lot then it would make it more readable later to do it that way.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this is solved by #293 :)

Copy link
Member

Choose a reason for hiding this comment

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

True :)

/* for ST devices, the action only occurs when we do GetStatus */
return dfu_target_check_status (target, cancellable, error);
}
#endif
Copy link
Member

@superm1 superm1 Oct 27, 2017

Choose a reason for hiding this comment

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

Why is this stuff #if'ed out? If it's going to stick around, at least indicate what the TODO is to restore it.

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess it can go completely, we have git history in case it's ever required. Will Fix.

@@ -171,6 +172,7 @@ typedef enum {
DFU_VERSION_DFU_1_0 = 0x0100,
DFU_VERSION_DFU_1_1 = 0x0110,
DFU_VERSION_DFUSE = 0x011a,
Copy link
Member

Choose a reason for hiding this comment

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

So shouldn't this be switched to DFU_VERSION_STM?

Copy link
Member Author

Choose a reason for hiding this comment

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

I flip-flopped on this. STM do actual call the version number DfuSe, and it's a defined value. I think adding a comment will make this clearer.

This allows us to show the user something they can include in a bug report.
This allows us to fail optional things and still show useful output in:

$ dfu-tool list
In the future we'll use this to set vendor-specific quirks.
This allows us to segment a buffer taking into account page borders and maximum
transfer sizes.
@hughsie
Copy link
Member Author

hughsie commented Oct 30, 2017

I've added two more commits, if those look good I think we can merge this.

Currently the only supported model is the AT32UC3A3256S, more to come...
When the AVR device is not recognised as a supported part we can't read or
write the firmware from the chip.
Guess the file type if it is not explicitly specified.
Also, fix the checksum to actually produce valid files...
Copy link
Member

@superm1 superm1 left a comment

Choose a reason for hiding this comment

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

LGTM

@hughsie hughsie merged commit 78c1e6c into master Oct 31, 2017
@hughsie hughsie deleted the wip/hughsie/atmel-flip branch October 31, 2017 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants