jacobrosenthal / hf2-rs

Microsoft HF2 HID Flashing Format for UF2 Bootloaders
49 stars 14 forks source link

Windows support #20

Closed elfmimi closed 4 years ago

elfmimi commented 4 years ago

fix https://github.com/jacobrosenthal/hf2-rs/issues/18 as well as https://github.com/jacobrosenthal/hf2-rs/issues/7 .

The second commit is to conform to the rule of 'report id' . https://docs.rs/hidapi/0.3.0/hidapi/struct.HidDevice.html#method.write

The first byte of data must contain the Report ID. For devices which only support a single report, this must be set to 0x0.

Windows need this treatment. I tested that modified code does work also on Linux. ~MacOS, not tested yet.~ Works fine on MacOS too.

note: this supersedes https://github.com/jacobrosenthal/hf2-rs/pull/8 .

jacobrosenthal commented 4 years ago

Yeah interesting. I did see reportid after the fact, but everything was working without it so .. :) I confirmed linux still seems good here. Ill grab someone to recheck mac

Ill put this in before #19 so this doesn't need a rebase.

Speaking of, any thoughts on that pr?

On Wed, Jun 3, 2020 at 6:55 AM a_p_u_r_o notifications@github.com wrote:

fix #18 https://github.com/jacobrosenthal/hf2-rs/issues/18 as well as #7 https://github.com/jacobrosenthal/hf2-rs/issues/7 .

The second commit is to conform to the rule of 'report id' . https://docs.rs/hidapi/0.3.0/hidapi/struct.HidDevice.html#method.write

The first byte of data must contain the Report ID. For devices which only support a single report, this must be set to 0x0.

Windows need this treatment. I tested that modified code does work also on Linux. MacOS, not tested yet.

You can view, comment on, or merge this pull request online at:

https://github.com/jacobrosenthal/hf2-rs/pull/20 Commit Summary

  • No ExitStatusExt for Windows.
  • Report ID can not be omitted.

File Changes

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jacobrosenthal/hf2-rs/pull/20, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADPI5B2TAZE5B3IMNX3AVTRUZI3ZANCNFSM4NRWCJCQ .

elfmimi commented 4 years ago

About https://github.com/jacobrosenthal/hf2-rs/pull/19 ?

cleanup my generic mess. Thats the major change here.

I was wondering what benefit those generics do. I was assuming that there should be some deeply rusty reason for that... it turned out...

If I ware to ask you a favor, I'd say I don't find this very pretty. Flashing "\\\\?\\C:\\Users\\applause\\Work\\SAMD21\\atsamd-rs\\boards\\xiao_m0\\target\\thumbv6m-none-eabi\\release\\examples\\blink" It would be preferable if the path relative to current directory or otherwise relative to the root of the workspace were shown, like this. Flashing "target/thumbv6m-none-eabi/release/examples/blink"

jacobrosenthal commented 4 years ago

On mac and linux it looks like Finished release [optimized + debuginfo] target(s) in 0.05s Searching for a connected device with known vid/pid pair. Trying Ok(Some("Adafruit Industries")) Ok(Some("PyGamer")) Flashing "/home/jacob/Downloads/atsamd/boards/pygamer/target/thumbv7em-none-eabihf/release/examples/ferris_img" Finished in 0.09s

So this issue doesnt appear to be path depth, but the println path formatter in windows. Perhaps you can google around a different formatting string for paths on windows that doesnt add all that?

On Thu, Jun 4, 2020 at 6:59 AM a_p_u_r_o notifications@github.com wrote:

About #19 https://github.com/jacobrosenthal/hf2-rs/pull/19 ?

cleanup my generic mess. Thats the major change here.

I was wondering what benefit those generics do. I was assuming that there should be some deeply rusty reason for that... it turned out...

If I ware to ask you a favor, I'd say I don't find this very pretty. Flashing "\\?\C:\Users\applause\Work\SAMD21\atsamd-rs\boards\xiao_m0\target\thumbv6m-none-eabi\release\examples\blink" It would be preferable if the path relative to current directory or otherwise relative to the root of the workspace were shown, like this. Flashing "target/thumbv6m-none-eabi/release/examples/blink"

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jacobrosenthal/hf2-rs/pull/20#issuecomment-638867532, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADPI5EM73O4JE67W2BVV3LRU6SFBANCNFSM4NRWCJCQ .