rewrite esc controller: periodic process func
This commit is contained in:
parent
fe8942575a
commit
06fd42430f
5 changed files with 78 additions and 113 deletions
|
|
@ -2,8 +2,9 @@
|
||||||
use esp_hal::{
|
use esp_hal::{
|
||||||
delay::Delay,
|
delay::Delay,
|
||||||
gpio::Level,
|
gpio::Level,
|
||||||
rmt::{Channel, PulseCode, Rx, Tx, TxChannelCreator},
|
rmt::{Channel, PulseCode, SingleShotTxTransaction},
|
||||||
};
|
};
|
||||||
|
use core::cell::{Ref, RefCell};
|
||||||
use num_traits::float::FloatCore;
|
use num_traits::float::FloatCore;
|
||||||
use rtt_target::{rprint, rprintln};
|
use rtt_target::{rprint, rprintln};
|
||||||
|
|
||||||
|
|
@ -49,7 +50,6 @@ impl BitTicks {
|
||||||
pub fn from_clk(
|
pub fn from_clk(
|
||||||
clk_speed: u32,
|
clk_speed: u32,
|
||||||
clk_divider: u8,
|
clk_divider: u8,
|
||||||
bit_times: BitTimes,
|
|
||||||
speed: DShotSpeed,
|
speed: DShotSpeed,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
let tick_len = (1. / clk_speed as f32) * (clk_divider as f32) * 1_000_000.;
|
let tick_len = (1. / clk_speed as f32) * (clk_divider as f32) * 1_000_000.;
|
||||||
|
|
@ -78,6 +78,7 @@ impl BitTimes {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy)]
|
#[derive(Debug, Clone, Copy)]
|
||||||
|
#[allow(dead_code)]
|
||||||
pub enum DShotSpeed {
|
pub enum DShotSpeed {
|
||||||
DShot150,
|
DShot150,
|
||||||
DShot300,
|
DShot300,
|
||||||
|
|
@ -108,24 +109,18 @@ impl DShotSpeed {
|
||||||
Self::DShot1200 => BitTimes::new(0.625, 0.313),
|
Self::DShot1200 => BitTimes::new(0.625, 0.313),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// These are for an 80 MHz clock with a clock divider setting of 1
|
|
||||||
pub fn default_bit_ticks(&self) -> BitTicks {
|
|
||||||
match &self {
|
|
||||||
Self::DShot150 => BitTicks::new(400, 200),
|
|
||||||
Self::DShot300 => BitTicks::new(200, 100),
|
|
||||||
Self::DShot600 => BitTicks::new(100, 50),
|
|
||||||
Self::DShot1200 => BitTicks::new(50, 25),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub struct DShot<'a> {
|
pub struct DShot<'a> {
|
||||||
rx_channel: &'a mut Channel<'static, esp_hal::Blocking, esp_hal::rmt::Rx>,
|
rx_channel: &'a mut Channel<'static, esp_hal::Blocking, esp_hal::rmt::Rx>,
|
||||||
tx_channel: &'a mut Channel<'static, esp_hal::Blocking, esp_hal::rmt::Tx>,
|
|
||||||
speed: DShotSpeed,
|
speed: DShotSpeed,
|
||||||
bit_ticks: BitTicks,
|
bit_ticks: BitTicks,
|
||||||
|
|
||||||
|
pulses: RefCell<[u32; 17]>,
|
||||||
|
requested_throttle: RefCell<u16>,
|
||||||
|
current_tx: RefCell<Option<SingleShotTxTransaction<'a, 'a, u32>>>,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> DShot<'a> {
|
impl<'a> DShot<'a> {
|
||||||
|
|
@ -139,19 +134,17 @@ impl<'a> DShot<'a> {
|
||||||
) -> Self {
|
) -> Self {
|
||||||
let clk_speed = clk_speed.unwrap_or(80_000_000);
|
let clk_speed = clk_speed.unwrap_or(80_000_000);
|
||||||
let clk_divider = clk_divider.unwrap_or(1);
|
let clk_divider = clk_divider.unwrap_or(1);
|
||||||
let bit_ticks = BitTicks::from_clk(clk_speed, clk_divider, speed.bit_times(), speed);
|
let bit_ticks = BitTicks::from_clk(clk_speed, clk_divider, speed);
|
||||||
rprint!(
|
|
||||||
"bit_ticks.t1_h:{},t1_l:{},t0_h:{},t0_l{}",
|
let txc = tx_channel.reborrow().transmit(&[0u32]).unwrap();
|
||||||
bit_ticks.t1_h,
|
|
||||||
bit_ticks.t1_l,
|
|
||||||
bit_ticks.t0_h,
|
|
||||||
bit_ticks.t0_l
|
|
||||||
);
|
|
||||||
Self {
|
Self {
|
||||||
rx_channel: rx_channel,
|
rx_channel: rx_channel,
|
||||||
tx_channel: tx_channel,
|
|
||||||
speed,
|
speed,
|
||||||
bit_ticks,
|
bit_ticks,
|
||||||
|
|
||||||
|
pulses: RefCell::new([0u32; 17]),
|
||||||
|
requested_throttle: RefCell::new(0),
|
||||||
|
current_tx: RefCell::new(Some(txc)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -169,16 +162,13 @@ impl<'a> DShot<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::needless_range_loop)]
|
#[allow(clippy::needless_range_loop)]
|
||||||
pub fn create_pulses(&mut self, throttle_value: u16, telemetry: bool) -> [u32; 17] {
|
pub fn create_pulses(&self, throttle_value: u16, telemetry: bool) -> [u32; 17] {
|
||||||
let frame = Self::create_frame(throttle_value, telemetry);
|
let frame = Self::create_frame(throttle_value, telemetry);
|
||||||
let mut pulses = [0; 17];
|
let mut pulses = [0; 17];
|
||||||
rprintln!("CREATING NEW FRAME!");
|
|
||||||
rprintln!("--------------------");
|
|
||||||
for i in 0..16 {
|
for i in 0..16 {
|
||||||
let bit = (frame >> (15 - i)) & 1;
|
let bit = (frame >> (15 - i)) & 1;
|
||||||
|
|
||||||
pulses[i] = if bit == 1 {
|
pulses[i] = if bit == 1 {
|
||||||
rprint!("1");
|
|
||||||
PulseCode::new(
|
PulseCode::new(
|
||||||
Level::High,
|
Level::High,
|
||||||
self.bit_ticks.t1_h,
|
self.bit_ticks.t1_h,
|
||||||
|
|
@ -187,7 +177,6 @@ impl<'a> DShot<'a> {
|
||||||
)
|
)
|
||||||
.into()
|
.into()
|
||||||
} else {
|
} else {
|
||||||
rprint!("0");
|
|
||||||
PulseCode::new(
|
PulseCode::new(
|
||||||
Level::High,
|
Level::High,
|
||||||
self.bit_ticks.t0_h,
|
self.bit_ticks.t0_h,
|
||||||
|
|
@ -197,30 +186,56 @@ impl<'a> DShot<'a> {
|
||||||
.into()
|
.into()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
rprintln!("");
|
|
||||||
rprintln!("--------------------");
|
|
||||||
|
|
||||||
pulses[16] = 0;
|
pulses[16] = 0;
|
||||||
pulses
|
pulses
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn write_throttle(&mut self, throttle: u16, telemetry: bool) -> Result<(), &'static str> {
|
pub fn process(&'a self) {
|
||||||
let pulses = self.create_pulses(throttle, telemetry);
|
let mut rc = self.current_tx.borrow_mut();
|
||||||
let tx_chann = self.tx_channel.reborrow();
|
if let Some(current) = rc.as_mut() {
|
||||||
let transaction = tx_chann
|
if current.poll() {
|
||||||
.transmit(&pulses)
|
// Schedule new transaction
|
||||||
.unwrap_or(return Err("Failed to send frame"))
|
let tx_chann = rc.take().unwrap().wait().unwrap();
|
||||||
.wait()
|
let mut pulses = self.pulses.borrow_mut();
|
||||||
.unwrap_or(return Err("Waiting failed!"));
|
let throttle = self.requested_throttle.borrow();
|
||||||
|
*pulses = self.create_pulses(*throttle, false);
|
||||||
|
let pulses = pulses.as_ref();
|
||||||
|
// SAFETY: eat shit, rust
|
||||||
|
let pulses = unsafe {
|
||||||
|
core::mem::transmute(pulses)
|
||||||
|
};
|
||||||
|
let m = tx_chann
|
||||||
|
.transmit(pulses)
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
Ok(())
|
//self.current_tx = Some(m);
|
||||||
|
*rc = Some(m);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Nothing to do, twiddle our thumbs.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn arm(&mut self, delay: &mut Delay) -> Result<(), &'static str> {
|
pub fn set_throttle(&self, v: u16) {
|
||||||
for _ in 0..100 {
|
*self.requested_throttle.borrow_mut() = v;
|
||||||
self.write_throttle(0, false)?;
|
}
|
||||||
delay.delay_millis(50);
|
|
||||||
|
#[allow(dead_code)]
|
||||||
|
pub fn arm(&'a self) -> Result<(), &'static str> {
|
||||||
|
let start = esp_hal::time::Instant::now();
|
||||||
|
|
||||||
|
rprintln!("ARM: Sending pre-throttle...");
|
||||||
|
while start.elapsed().as_secs() < 2 {
|
||||||
|
self.set_throttle(100);
|
||||||
|
self.process();
|
||||||
}
|
}
|
||||||
|
rprintln!("ARM: Sending 0...");
|
||||||
|
while start.elapsed().as_secs() < 4 {
|
||||||
|
self.set_throttle(0);
|
||||||
|
self.process();
|
||||||
|
}
|
||||||
|
rprintln!("ARM: Done.");
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,2 @@
|
||||||
pub mod afroesc;
|
//pub mod afroesc;
|
||||||
pub mod dshot;
|
pub mod dshot;
|
||||||
pub enum EscState {
|
|
||||||
Starting,
|
|
||||||
Running,
|
|
||||||
Stopping,
|
|
||||||
Stop,
|
|
||||||
}
|
|
||||||
//taken from: https://docs.arduino.cc/language-reference/en/functions/math/map/
|
|
||||||
//used for the ramp up of the spincoater
|
|
||||||
pub fn arduino_map(x: i32, in_min: i32, in_max: i32, out_min: i32, out_max: i32) -> i32 {
|
|
||||||
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
reason = "mem::forget is generally not safe to do with esp_hal types, especially those \
|
reason = "mem::forget is generally not safe to do with esp_hal types, especially those \
|
||||||
holding buffers for the duration of a data transfer."
|
holding buffers for the duration of a data transfer."
|
||||||
)]
|
)]
|
||||||
|
use alloc::boxed::Box;
|
||||||
use alloc::string::ToString;
|
use alloc::string::ToString;
|
||||||
use esp_hal::clock::CpuClock;
|
use esp_hal::clock::CpuClock;
|
||||||
use esp_hal::delay::Delay;
|
use esp_hal::delay::Delay;
|
||||||
|
|
@ -14,26 +15,21 @@ use esp_hal::uart::{Config, Uart};
|
||||||
use esp_hal::gpio::Event;
|
use esp_hal::gpio::Event;
|
||||||
use esp_hal::gpio::{Input, InputConfig};
|
use esp_hal::gpio::{Input, InputConfig};
|
||||||
use esp_hal::handler;
|
use esp_hal::handler;
|
||||||
use esp_hal::mcpwm::operator::PwmPinConfig;
|
|
||||||
use esp_hal::mcpwm::timer::PwmWorkingMode;
|
|
||||||
use esp_hal::rmt::{Rmt, TxChannelConfig, TxChannelCreator};
|
use esp_hal::rmt::{Rmt, TxChannelConfig, TxChannelCreator};
|
||||||
use esp_hal::time::Rate;
|
use esp_hal::time::Rate;
|
||||||
|
|
||||||
use core::cell::RefCell;
|
use core::cell::RefCell;
|
||||||
|
use core::mem::forget;
|
||||||
use critical_section::Mutex;
|
use critical_section::Mutex;
|
||||||
use esp_backtrace as _;
|
use esp_backtrace as _;
|
||||||
use esp_hal::time::{Duration, Instant};
|
|
||||||
use esp_hal::timer::timg::TimerGroup;
|
|
||||||
use rtt_target::rprintln;
|
use rtt_target::rprintln;
|
||||||
mod dc_driver;
|
mod dc_driver;
|
||||||
|
|
||||||
mod peripherals;
|
mod peripherals;
|
||||||
|
|
||||||
use dc_driver::afroesc::AfroEsc;
|
|
||||||
use peripherals::nextion::Nextion;
|
use peripherals::nextion::Nextion;
|
||||||
|
|
||||||
//DSHOT via rmt!
|
//DSHOT via rmt!
|
||||||
use dc_driver::dshot::DShot;
|
|
||||||
use dc_driver::dshot::DShotSpeed;
|
use dc_driver::dshot::DShotSpeed;
|
||||||
|
|
||||||
use crate::dc_driver::dshot;
|
use crate::dc_driver::dshot;
|
||||||
|
|
@ -57,9 +53,6 @@ const DEFAULT_SPIN_TIME: u32 = 10;
|
||||||
// For more information see: <https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/system/app_image_format.html#application-description>
|
// For more information see: <https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/system/app_image_format.html#application-description>
|
||||||
esp_bootloader_esp_idf::esp_app_desc!();
|
esp_bootloader_esp_idf::esp_app_desc!();
|
||||||
use crate::peripherals::Command;
|
use crate::peripherals::Command;
|
||||||
use esp_hal::gpio::Level;
|
|
||||||
use esp_hal::gpio::Output;
|
|
||||||
use esp_hal::gpio::OutputConfig;
|
|
||||||
|
|
||||||
#[main]
|
#[main]
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
|
@ -69,29 +62,15 @@ fn main() -> ! {
|
||||||
|
|
||||||
let config = esp_hal::Config::default().with_cpu_clock(CpuClock::max());
|
let config = esp_hal::Config::default().with_cpu_clock(CpuClock::max());
|
||||||
let peripherals = esp_hal::init(config);
|
let peripherals = esp_hal::init(config);
|
||||||
let system = peripherals.SYSTEM;
|
let delay = Delay::new();
|
||||||
let mut delay = Delay::new();
|
|
||||||
|
|
||||||
esp_alloc::heap_allocator!(#[esp_hal::ram(reclaimed)] size: 65536);
|
esp_alloc::heap_allocator!(#[esp_hal::ram(reclaimed)] size: 65536);
|
||||||
let clock_config =
|
|
||||||
esp_hal::mcpwm::PeripheralClockConfig::with_frequency(Rate::from_mhz(32)).unwrap();
|
|
||||||
let mut mcpwm = esp_hal::mcpwm::McPwm::new(peripherals.MCPWM0, clock_config);
|
|
||||||
mcpwm.operator0.set_timer(&mcpwm.timer0);
|
|
||||||
|
|
||||||
let mut pwm_pin = mcpwm
|
|
||||||
.operator0
|
|
||||||
.with_pin_a(peripherals.GPIO18, PwmPinConfig::UP_ACTIVE_HIGH);
|
|
||||||
let timer_clock_cfg = clock_config
|
|
||||||
.timer_clock_with_frequency(19_999, PwmWorkingMode::Increase, Rate::from_hz(50))
|
|
||||||
.unwrap();
|
|
||||||
mcpwm.timer0.start(timer_clock_cfg);
|
|
||||||
|
|
||||||
//setup RMT
|
//setup RMT
|
||||||
let freq = Rate::from_mhz(80);
|
let freq = Rate::from_mhz(80);
|
||||||
let rmt = Rmt::new(peripherals.RMT, freq).expect("CAN NOT SET FREQUENCY");
|
let rmt = Rmt::new(peripherals.RMT, freq).expect("CAN NOT SET FREQUENCY");
|
||||||
let rx_config = RxChannelConfig::default().with_clk_divider(1);
|
let rx_config = RxChannelConfig::default().with_clk_divider(1);
|
||||||
let tx_config = TxChannelConfig::default().with_clk_divider(1);
|
let tx_config = TxChannelConfig::default().with_clk_divider(1);
|
||||||
let mut toggle_pin = Output::new(peripherals.GPIO2, Level::Low, OutputConfig::default());
|
|
||||||
let mut tx_channel = rmt
|
let mut tx_channel = rmt
|
||||||
.channel0
|
.channel0
|
||||||
.configure_tx(peripherals.GPIO23, tx_config)
|
.configure_tx(peripherals.GPIO23, tx_config)
|
||||||
|
|
@ -100,20 +79,24 @@ fn main() -> ! {
|
||||||
.channel3
|
.channel3
|
||||||
.configure_rx(peripherals.GPIO14, rx_config)
|
.configure_rx(peripherals.GPIO14, rx_config)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let mut dshot_esc = dshot::DShot::new(
|
let dshot_esc = dshot::DShot::new(
|
||||||
&mut rx_channel,
|
&mut rx_channel,
|
||||||
&mut tx_channel,
|
&mut tx_channel,
|
||||||
DShotSpeed::DShot600,
|
DShotSpeed::DShot600,
|
||||||
Some(80_000_000),
|
Some(80_000_000),
|
||||||
Some(1),
|
Some(1),
|
||||||
);
|
);
|
||||||
rprintln!("SENDING RMT");
|
let dshot_esc = Box::new(dshot_esc);
|
||||||
|
let dshot_esc = Box::leak(dshot_esc);
|
||||||
|
|
||||||
|
//dshot_esc.arm(&delay).unwrap();
|
||||||
|
|
||||||
|
dshot_esc.arm();
|
||||||
loop {
|
loop {
|
||||||
delay.delay_millis(1000);
|
dshot_esc.process();
|
||||||
toggle_pin.set_high();
|
dshot_esc.set_throttle(200);
|
||||||
dshot_esc.write_throttle(2047, true);
|
|
||||||
toggle_pin.set_low();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// rprintln!("RMT SENT!");
|
// rprintln!("RMT SENT!");
|
||||||
// let mut esc = AfroEsc::new(&mut pwm_pin);;
|
// let mut esc = AfroEsc::new(&mut pwm_pin);;
|
||||||
// esc.set_timestamp(1000);
|
// esc.set_timestamp(1000);
|
||||||
|
|
@ -149,8 +132,8 @@ fn main() -> ! {
|
||||||
let mut display = Nextion::new(&mut uart0);
|
let mut display = Nextion::new(&mut uart0);
|
||||||
|
|
||||||
display.send_command(b"page page0");
|
display.send_command(b"page page0");
|
||||||
let mut rpm = DEFAULT_TARGET_RPM;
|
let mut _rpm = DEFAULT_TARGET_RPM;
|
||||||
let mut timer = DEFAULT_SPIN_TIME;
|
let mut _timer = DEFAULT_SPIN_TIME;
|
||||||
let mut started = false;
|
let mut started = false;
|
||||||
loop {
|
loop {
|
||||||
if display.read_ready() {
|
if display.read_ready() {
|
||||||
|
|
@ -169,11 +152,11 @@ fn main() -> ! {
|
||||||
}
|
}
|
||||||
Ok(Command::SetRpm(x)) => {
|
Ok(Command::SetRpm(x)) => {
|
||||||
rprintln!("SET_RPM with {}", x);
|
rprintln!("SET_RPM with {}", x);
|
||||||
rpm = x;
|
_rpm = x;
|
||||||
}
|
}
|
||||||
Ok(Command::SetTimer(x)) => {
|
Ok(Command::SetTimer(x)) => {
|
||||||
rprintln!("SETTING TIMER {}", x);
|
rprintln!("SETTING TIMER {}", x);
|
||||||
timer = x;
|
_timer = x;
|
||||||
}
|
}
|
||||||
Ok(Command::SendConfig) => {
|
Ok(Command::SendConfig) => {
|
||||||
rprintln!("SEND CONFIG");
|
rprintln!("SEND CONFIG");
|
||||||
|
|
@ -193,30 +176,7 @@ fn main() -> ! {
|
||||||
// spincoater.armed();
|
// spincoater.armed();
|
||||||
rprintln!("STARTING!")
|
rprintln!("STARTING!")
|
||||||
}
|
}
|
||||||
//display.send_command(b"page page0");
|
|
||||||
//uart0.write(b"page page0\xff\xff\xff");
|
|
||||||
}
|
}
|
||||||
// Example: Ramp from 0% to 50% throttle
|
|
||||||
//the afro esc starts turning at roughly setup gets a PWM at
|
|
||||||
//loop{
|
|
||||||
// for pulse in 1120..1500 {
|
|
||||||
// rprintln!("pulse:{}",pulse);
|
|
||||||
// pwm_pin.set_timestamp(pulse);
|
|
||||||
// Timer::after_millis(3000).await;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Timer::after_millis(1000).await;
|
|
||||||
|
|
||||||
// // Return to idle
|
|
||||||
// pwm_pin.set_timestamp(1000);
|
|
||||||
// Timer::after_millis(1000).await;
|
|
||||||
// }
|
|
||||||
loop {
|
|
||||||
rprintln!("Hello world!");
|
|
||||||
delay.delay_millis(3000);
|
|
||||||
}
|
|
||||||
|
|
||||||
// for inspiration have a look at the examples at https://github.com/esp-rs/esp-hal/tree/esp-hal-v1.0.0/examples/src/bin
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[handler]
|
#[handler]
|
||||||
|
|
@ -224,7 +184,7 @@ fn main() -> ! {
|
||||||
fn handler() {
|
fn handler() {
|
||||||
critical_section::with(|cs| {
|
critical_section::with(|cs| {
|
||||||
let mut binding = EMERGENCY_BUTTON.borrow_ref_mut(cs);
|
let mut binding = EMERGENCY_BUTTON.borrow_ref_mut(cs);
|
||||||
let mut button = binding.as_mut().unwrap();
|
let button = binding.as_mut().unwrap();
|
||||||
if button.is_interrupt_set() {
|
if button.is_interrupt_set() {
|
||||||
// do the thing
|
// do the thing
|
||||||
rprintln!("BUTTON1 WAS PRESSED!");
|
rprintln!("BUTTON1 WAS PRESSED!");
|
||||||
|
|
|
||||||
|
|
@ -11,5 +11,6 @@ pub enum Command {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum ErrCommand {
|
pub enum ErrCommand {
|
||||||
NoValidCmd,
|
NoValidCmd,
|
||||||
|
#[allow(dead_code)]
|
||||||
ReadError,
|
ReadError,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ impl<'a> Nextion<'a> {
|
||||||
let mut buf: [u8; 8] = [0; 8];
|
let mut buf: [u8; 8] = [0; 8];
|
||||||
let _read_bytes = match self.read_frame(&mut buf) {
|
let _read_bytes = match self.read_frame(&mut buf) {
|
||||||
Ok(x) => x,
|
Ok(x) => x,
|
||||||
Err(e) => {
|
Err(_e) => {
|
||||||
rprintln!("ERROR while reading");
|
rprintln!("ERROR while reading");
|
||||||
return Err(ErrCommand::NoValidCmd);
|
return Err(ErrCommand::NoValidCmd);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue