fix tab/space

This commit is contained in:
occheung 2020-09-25 14:24:33 +08:00
parent 84eec58ee1
commit dff726d121
9 changed files with 1424 additions and 1425 deletions

View File

@ -1,15 +1,16 @@
#![no_main] #![no_main]
#![no_std] #![no_std]
#![feature(str_strip)] #![feature(str_strip)]
use log::{ trace, debug, info, warn }; #![feature(core_intrinsics)]
use stm32h7xx_hal::hal::digital::v2::InputPin;
use log::{ trace };
use stm32h7xx_hal::gpio::Speed; use stm32h7xx_hal::gpio::Speed;
use stm32h7xx_hal::{pac, prelude::*, spi}; use stm32h7xx_hal::{pac, prelude::*, spi};
use stm32h7xx_hal::ethernet; use stm32h7xx_hal::ethernet;
use smoltcp as net; use smoltcp as net;
use minimq::{ use minimq::{
embedded_nal::{IpAddr, Ipv4Addr, TcpStack}, embedded_nal::{ IpAddr, Ipv4Addr },
MqttClient, QoS MqttClient, QoS
}; };
@ -17,7 +18,6 @@ use cortex_m;
use cortex_m_rt::entry; use cortex_m_rt::entry;
use rtic::cyccnt::{Instant, U32Ext}; use rtic::cyccnt::{Instant, U32Ext};
use heapless::Vec;
use heapless::consts; use heapless::consts;
#[macro_use] #[macro_use]
@ -106,7 +106,7 @@ fn main() -> ! {
let gpiob = dp.GPIOB.split(ccdr.peripheral.GPIOB); let gpiob = dp.GPIOB.split(ccdr.peripheral.GPIOB);
let gpioc = dp.GPIOC.split(ccdr.peripheral.GPIOC); let gpioc = dp.GPIOC.split(ccdr.peripheral.GPIOC);
let gpiod = dp.GPIOD.split(ccdr.peripheral.GPIOD); let gpiod = dp.GPIOD.split(ccdr.peripheral.GPIOD);
let gpioe = dp.GPIOE.split(ccdr.peripheral.GPIOE); let _gpioe = dp.GPIOE.split(ccdr.peripheral.GPIOE);
let gpiof = dp.GPIOF.split(ccdr.peripheral.GPIOF); let gpiof = dp.GPIOF.split(ccdr.peripheral.GPIOF);
let gpiog = dp.GPIOG.split(ccdr.peripheral.GPIOG); let gpiog = dp.GPIOG.split(ccdr.peripheral.GPIOG);
@ -207,7 +207,7 @@ fn main() -> ! {
let spi = dp.SPI6.spi( let spi = dp.SPI6.spi(
(sclk, miso, mosi), (sclk, miso, mosi),
spi::MODE_0, spi::MODE_0,
10.mhz(), 2.mhz(),
ccdr.peripheral.SPI6, ccdr.peripheral.SPI6,
&ccdr.clocks, &ccdr.clocks,
); );
@ -271,7 +271,7 @@ fn main() -> ! {
.poll(|_client, topic, message, _properties| { .poll(|_client, topic, message, _properties| {
// info!("On {:?}, received: {:?}", topic, message); // info!("On {:?}, received: {:?}", topic, message);
// Why is topic a string while message is a slice? // Why is topic a string while message is a slice?
mqtt_mux.process_mqtt(topic, message).is_ok(); mqtt_mux.process_mqtt(topic, message).unwrap();
}).is_ok(); }).is_ok();
if connection && !has_subscribed && tick { if connection && !has_subscribed && tick {

View File

@ -318,7 +318,7 @@ where
} }
} }
} }
self.multi_dds.set_sys_clk_frequency(reported_f_sys_clk); self.multi_dds.set_sys_clk_frequency(reported_f_sys_clk)?;
self.multi_dds.set_single_tone_profile(profile, frequency, phase, amplitude)?; self.multi_dds.set_single_tone_profile(profile, frequency, phase, amplitude)?;
self.invoke_io_update()?; self.invoke_io_update()?;
Ok(()) Ok(())
@ -334,5 +334,4 @@ where
(CFGMask::IO_UPDATE, 0) (CFGMask::IO_UPDATE, 0)
]).map(|_| ()) ]).map(|_| ())
} }
} }