aboutsummaryrefslogtreecommitdiff
path: root/embassy-rp/src/uart/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-rp/src/uart/mod.rs')
-rw-r--r--embassy-rp/src/uart/mod.rs38
1 files changed, 9 insertions, 29 deletions
diff --git a/embassy-rp/src/uart/mod.rs b/embassy-rp/src/uart/mod.rs
index 00070b80a..202b0883e 100644
--- a/embassy-rp/src/uart/mod.rs
+++ b/embassy-rp/src/uart/mod.rs
@@ -807,26 +807,26 @@ mod eh02 {
807mod eh1 { 807mod eh1 {
808 use super::*; 808 use super::*;
809 809
810 impl embedded_hal_1::serial::Error for Error { 810 impl embedded_hal_nb::serial::Error for Error {
811 fn kind(&self) -> embedded_hal_1::serial::ErrorKind { 811 fn kind(&self) -> embedded_hal_nb::serial::ErrorKind {
812 match *self { 812 match *self {
813 Self::Framing => embedded_hal_1::serial::ErrorKind::FrameFormat, 813 Self::Framing => embedded_hal_nb::serial::ErrorKind::FrameFormat,
814 Self::Break => embedded_hal_1::serial::ErrorKind::Other, 814 Self::Break => embedded_hal_nb::serial::ErrorKind::Other,
815 Self::Overrun => embedded_hal_1::serial::ErrorKind::Overrun, 815 Self::Overrun => embedded_hal_nb::serial::ErrorKind::Overrun,
816 Self::Parity => embedded_hal_1::serial::ErrorKind::Parity, 816 Self::Parity => embedded_hal_nb::serial::ErrorKind::Parity,
817 } 817 }
818 } 818 }
819 } 819 }
820 820
821 impl<'d, T: Instance, M: Mode> embedded_hal_1::serial::ErrorType for Uart<'d, T, M> { 821 impl<'d, T: Instance, M: Mode> embedded_hal_nb::serial::ErrorType for UartRx<'d, T, M> {
822 type Error = Error; 822 type Error = Error;
823 } 823 }
824 824
825 impl<'d, T: Instance, M: Mode> embedded_hal_1::serial::ErrorType for UartTx<'d, T, M> { 825 impl<'d, T: Instance, M: Mode> embedded_hal_nb::serial::ErrorType for UartTx<'d, T, M> {
826 type Error = Error; 826 type Error = Error;
827 } 827 }
828 828
829 impl<'d, T: Instance, M: Mode> embedded_hal_1::serial::ErrorType for UartRx<'d, T, M> { 829 impl<'d, T: Instance, M: Mode> embedded_hal_nb::serial::ErrorType for Uart<'d, T, M> {
830 type Error = Error; 830 type Error = Error;
831 } 831 }
832 832
@@ -851,16 +851,6 @@ mod eh1 {
851 } 851 }
852 } 852 }
853 853
854 impl<'d, T: Instance, M: Mode> embedded_hal_1::serial::Write for UartTx<'d, T, M> {
855 fn write(&mut self, buffer: &[u8]) -> Result<(), Self::Error> {
856 self.blocking_write(buffer)
857 }
858
859 fn flush(&mut self) -> Result<(), Self::Error> {
860 self.blocking_flush()
861 }
862 }
863
864 impl<'d, T: Instance, M: Mode> embedded_hal_nb::serial::Write for UartTx<'d, T, M> { 854 impl<'d, T: Instance, M: Mode> embedded_hal_nb::serial::Write for UartTx<'d, T, M> {
865 fn write(&mut self, char: u8) -> nb::Result<(), Self::Error> { 855 fn write(&mut self, char: u8) -> nb::Result<(), Self::Error> {
866 self.blocking_write(&[char]).map_err(nb::Error::Other) 856 self.blocking_write(&[char]).map_err(nb::Error::Other)
@@ -877,16 +867,6 @@ mod eh1 {
877 } 867 }
878 } 868 }
879 869
880 impl<'d, T: Instance, M: Mode> embedded_hal_1::serial::Write for Uart<'d, T, M> {
881 fn write(&mut self, buffer: &[u8]) -> Result<(), Self::Error> {
882 self.blocking_write(buffer)
883 }
884
885 fn flush(&mut self) -> Result<(), Self::Error> {
886 self.blocking_flush()
887 }
888 }
889
890 impl<'d, T: Instance, M: Mode> embedded_hal_nb::serial::Write for Uart<'d, T, M> { 870 impl<'d, T: Instance, M: Mode> embedded_hal_nb::serial::Write for Uart<'d, T, M> {
891 fn write(&mut self, char: u8) -> nb::Result<(), Self::Error> { 871 fn write(&mut self, char: u8) -> nb::Result<(), Self::Error> {
892 self.blocking_write(&[char]).map_err(nb::Error::Other) 872 self.blocking_write(&[char]).map_err(nb::Error::Other)