mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
services/llio: Implement From instead of Into
Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
This commit is contained in:
parent
91e4b9fa15
commit
479694869a
2 changed files with 12 additions and 12 deletions
|
|
@ -27,9 +27,9 @@ impl From<usize> for UartType {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
impl Into<usize> for UartType {
|
impl From<UartType> for usize {
|
||||||
fn into(self) -> usize {
|
fn from(uart_type: UartType) -> usize {
|
||||||
match self {
|
match uart_type {
|
||||||
UartType::Kernel => 0,
|
UartType::Kernel => 0,
|
||||||
UartType::Log => 1,
|
UartType::Log => 1,
|
||||||
UartType::Application => 2,
|
UartType::Application => 2,
|
||||||
|
|
@ -38,9 +38,9 @@ impl Into<usize> for UartType {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// for the actual bitmask going to hardware
|
// for the actual bitmask going to hardware
|
||||||
impl Into<u32> for UartType {
|
impl From<UartType> for u32 {
|
||||||
fn into(self) -> u32 {
|
fn from(uart_type: UartType) -> u32 {
|
||||||
match self {
|
match uart_type {
|
||||||
UartType::Kernel => 0,
|
UartType::Kernel => 0,
|
||||||
UartType::Log => 1,
|
UartType::Log => 1,
|
||||||
UartType::Application => 2,
|
UartType::Application => 2,
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,9 @@ impl From<usize> for VibePattern {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
impl Into<usize> for VibePattern {
|
impl From<VibePattern> for usize {
|
||||||
fn into(self) -> usize {
|
fn from(pat: VibePattern) -> usize {
|
||||||
match self {
|
match pat {
|
||||||
VibePattern::Long => 0,
|
VibePattern::Long => 0,
|
||||||
VibePattern::Double => 1,
|
VibePattern::Double => 1,
|
||||||
VibePattern::Short => 0xffff_ffff,
|
VibePattern::Short => 0xffff_ffff,
|
||||||
|
|
@ -39,9 +39,9 @@ impl From<usize> for ClockMode {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
impl Into<usize> for ClockMode {
|
impl From<ClockMode> for usize {
|
||||||
fn into(self) -> usize {
|
fn from(mode: ClockMode) -> usize {
|
||||||
match self {
|
match mode {
|
||||||
ClockMode::Low => 0,
|
ClockMode::Low => 0,
|
||||||
ClockMode::AllOn => 0xffff_ffff,
|
ClockMode::AllOn => 0xffff_ffff,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue