-
Notifications
You must be signed in to change notification settings - Fork 1
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
Update build environment and dependencies #2
Conversation
Nice work 🚀 |
application/src/control.rs
Outdated
ConfigKey::Json => { | ||
xfer.accept_with(&cfg.json).ok(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note: no action is required.
We will have an issue with .json once it gets bigger than the transfer size. I don't know what the default is or what we configured.
On the software I was starting to move name/tags/usbconsole under json , as those are details that the microcontroller itself does not care about, or use for anything,.... but the transfer size could be a good reason to stop doing such thing.
application/src/control.rs
Outdated
ReadKey::Power => { | ||
let mut buf = heapless::Vec::<u8, 128>::new(); | ||
write!(buf, "{:.2}W", self.data.power).ok(); | ||
xfer.accept_with(&buf).ok(); | ||
} | ||
ReadKey::Voltage => { | ||
let mut buf = heapless::Vec::<u8, 128>::new(); | ||
write!(buf, "{:.2}V", self.data.voltage).ok(); | ||
xfer.accept_with(&buf).ok(); | ||
} | ||
ReadKey::Current => { | ||
let mut buf = heapless::Vec::<u8, 128>::new(); | ||
write!(buf, "{:.2}A", self.data.current).ok(); | ||
xfer.accept_with(&buf).ok(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add another command to read them all at once?
I would expect that we periodically poll during the execution of a test, and ideally we would want the three values (actually just current and voltage would give us all we need), May be ReadKey:CurrentVoltage?
application/src/control.rs
Outdated
} | ||
Ok(ControlRequest::Power) => { | ||
if let Ok(action) = req.value.try_into() { | ||
self.power = Some(action); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah nice, so you decouple the reception of the control commands/data, with the actuator. I guess it isolates the objects each task has access to.
application/src/main.rs
Outdated
let led_rx = cx.shared.led_rx; | ||
let to_host_serial = cx.local.to_host_serial; | ||
let led_rx = cx.shared.led_rx; | ||
let serial2 = cx.shared.serial2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may be now we should just call it dut_usb_serial or dut_vcp? there is no serial1
application/src/main.rs
Outdated
} | ||
} | ||
} | ||
} | ||
|
||
fn escaped_char(c:u8) -> Option<u8> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so much complexity went away :D ... ❤️
Extracted the control interface to its own PR: #3 |
Ooppss sorry, now this one is in merge conflict, I must have merged this long ago |
Rebased, lemme test. |
.strings(&[ | ||
StringDescriptors::new(LangID::EN) | ||
.manufacturer("Red Hat Inc.") | ||
.product("Jumpstarter DFU Mode") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.product("Jumpstarter DFU Mode") | |
.product("Dutlink DFU Mode") |
not related to this change, but since we are at it...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have suggestion, but let's do it later :)
Only tested power control and storage switching.