Conversation
|
proc-macro2 will be compatible with the new nightlies soon dtolnay/quote#73 |
| FwUp = 11, | ||
| CustomLed = 12, | ||
| CustomKey = 13, | ||
| Reserved, |
There was a problem hiding this comment.
I think these needs to stay, so that send_buffer[pos] = message_type as u8; in Serial::send works correctly consistently? Especially for operation codes, those are dis-contiguous
There was a problem hiding this comment.
Maybe we could use the write functionality in scroll for that as well? Agree that we need to be careful about preserving what actually goes on the wire, so codes don't change.
|
Oh that's really nice, I had been looking for a lib that does exactly this but hadn't tried out |
| unknown => { | ||
| return Err(SError::BadInput { | ||
| size: unknown as usize, | ||
| msg: "MsgType", |
There was a problem hiding this comment.
I try to sneak the unknown byte into the error message here, it should be formatted as (fmt, "bad input {} ({})", msg, size) with semihosting
| FwInfo => 10, | ||
| FwUp => 11, | ||
| CustomLed => 12, | ||
| CustomKey => 13, |
There was a problem hiding this comment.
This looks ripe for a macro. scroll_derive doesn't support deriving on enums, so we'll need to write one here.
|
I'd like to make some round-trip tests to run on x86-64 too. |
|
The test target hard-codes linux-gnu though, I will try to extract |
This currently requires openocd from git for the best experience.
As a PoC it only parses one byte. Next up would be
buffer.pread::<Message>(0), but I haven't cooked up a multiplexingtry_from_ctxfor the different MsgType + XOp yet.Further, we could have
buffer.pwrite::<LedTheme>for sending the 0xca set-LED messages too.cc #20