mirror of
https://github.com/esp-rs/esp-hal.git
synced 2025-09-30 22:01:11 +00:00
Implement the ufmt_write::uWrite
trait for the USB Serial JTAG driver (#751)
* Implement the `ufmt_write::uWrite` trait for the USB Serial JTAG driver * Update CHANGELOG
This commit is contained in:
parent
83e138a5d3
commit
9acb915fb9
@ -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
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user