Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add GPIO (output) and delay functionality to `esp32c6-lp-hal` (#715)
- Implement RTCIO pullup, pulldown and hold control for Xtensa MCUs (#684)
- Add GPIO input support and implement additional `embedded-hal` output traits for the C6's LP core [#720]
- Implement `ufmt_write::uWrite` trait for USB Serial JTAG (#751)

### Changed

Expand Down
19 changes: 19 additions & 0 deletions esp-hal-common/src/usb_serial_jtag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,25 @@ impl core::fmt::Write for UsbSerialJtag<'_> {
}
}

#[cfg(feature = "ufmt")]
impl ufmt_write::uWrite for UsbSerialJtag<'_> {
type Error = Error;

#[inline]
fn write_str(&mut self, s: &str) -> Result<(), Self::Error> {
self.write_bytes(s.as_bytes())?;
Ok(())
}

#[inline]
fn write_char(&mut self, ch: char) -> Result<(), Self::Error> {
let mut buffer = [0u8; 4];
self.write_bytes(ch.encode_utf8(&mut buffer).as_bytes())?;

Ok(())
}
}

impl embedded_hal::serial::Read<u8> for UsbSerialJtag<'_> {
type Error = Error;

Expand Down