Skip to content

Commit

Permalink
Implement for embassy-net and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rukai committed May 29, 2021
1 parent 5061375 commit 0b8e456
Show file tree
Hide file tree
Showing 13 changed files with 6 additions and 132 deletions.
2 changes: 2 additions & 0 deletions embassy-net/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ defmt-debug = []
defmt-info = []
defmt-warn = []
defmt-error = []
defmt-enable = [ "defmt", "embassy/defmt-enable", "embassy-fmt/defmt" ]

tcp = ["smoltcp/socket-tcp"]
dhcpv4 = ["medium-ethernet", "smoltcp/socket-dhcpv4"]
Expand All @@ -23,6 +24,7 @@ defmt = { version = "0.2.0", optional = true }
log = { version = "0.4.11", optional = true }

embassy = { version = "0.1.0", path = "../embassy" }
embassy-fmt = { version = "0.1.0", path = "../embassy-fmt" }

managed = { version = "0.8.0", default-features = false, features = [ "map" ]}
heapless = { version = "0.5.6", default-features = false }
Expand Down
1 change: 0 additions & 1 deletion embassy-net/src/config/dhcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use smoltcp::time::Instant;

use super::*;
use crate::device::LinkState;
use crate::fmt::*;
use crate::{Interface, SocketSet};

pub struct DhcpConfigurator {
Expand Down
1 change: 0 additions & 1 deletion embassy-net/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use heapless::Vec;
use smoltcp::time::Instant;
use smoltcp::wire::{Ipv4Address, Ipv4Cidr};

use crate::fmt::*;
use crate::{Interface, SocketSet};

mod statik;
Expand Down
1 change: 0 additions & 1 deletion embassy-net/src/config/statik.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use smoltcp::time::Instant;

use super::*;
use crate::fmt::*;
use crate::{Interface, SocketSet};

pub struct StaticConfigurator {
Expand Down
1 change: 0 additions & 1 deletion embassy-net/src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use smoltcp::phy::Device as SmolDevice;
use smoltcp::phy::DeviceCapabilities;
use smoltcp::time::Instant as SmolInstant;

use crate::fmt::*;
use crate::packet_pool::PacketBoxExt;
use crate::Result;
use crate::{Packet, PacketBox, PacketBuf};
Expand Down
118 changes: 0 additions & 118 deletions embassy-net/src/fmt.rs

This file was deleted.

4 changes: 2 additions & 2 deletions embassy-net/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![cfg_attr(not(feature = "std"), no_std)]

// This mod MUST go first, so that the others see its macros.
pub(crate) mod fmt;
#[macro_use]
extern crate embassy_fmt;

mod config;
mod device;
Expand Down
1 change: 0 additions & 1 deletion embassy-net/src/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ use smoltcp::wire::{IpAddress, IpCidr, Ipv4Address, Ipv4Cidr};
use crate::config::Configurator;
use crate::config::Event;
use crate::device::{Device, DeviceAdapter, LinkState};
use crate::fmt::*;
use crate::{Interface, SocketSet};

const ADDRESSES_LEN: usize = 1;
Expand Down
1 change: 0 additions & 1 deletion embassy-net/src/tcp_socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use smoltcp::time::Duration;
use smoltcp::wire::IpEndpoint;

use super::stack::Stack;
use crate::fmt::*;
use crate::{Error, Result};

pub struct TcpSocket<'a> {
Expand Down
3 changes: 1 addition & 2 deletions embassy-nrf/src/spim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ use futures::future::poll_fn;
use traits::spi::FullDuplex;

use crate::gpio::sealed::Pin as _;
use crate::gpio::{OptionalPin, Pin as GpioPin};
use crate::gpio::{self, OptionalPin, Pin as GpioPin};
use crate::interrupt::Interrupt;
use crate::gpio;
use crate::{pac, util::slice_in_ram_or};

pub use embedded_hal::spi::{Mode, Phase, Polarity, MODE_0, MODE_1, MODE_2, MODE_3};
Expand Down
3 changes: 1 addition & 2 deletions embassy-nrf/src/twim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ use embassy::util::{AtomicWaker, Unborrow};
use embassy_extras::unborrow;

use crate::chip::{EASY_DMA_SIZE, FORCE_COPY_BUFFER_SIZE};
use crate::gpio::Pin as GpioPin;
use crate::gpio::{self, Pin as GpioPin};
use crate::pac;
use crate::util::{slice_in_ram, slice_in_ram_or};
use crate::gpio;

pub enum Frequency {
#[doc = "26738688: 100 kbps"]
Expand Down
1 change: 0 additions & 1 deletion embassy-stm32/src/rcc/h7/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use core::marker::PhantomData;

use embassy::util::Unborrow;

use crate::fmt::{assert, panic};
use crate::pac::peripherals;
use crate::pac::rcc::vals::Timpre;
use crate::pac::{DBGMCU, RCC, SYSCFG};
Expand Down
1 change: 0 additions & 1 deletion embassy-stm32/src/rcc/h7/pll.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use super::{Hertz, RCC};
use crate::fmt::assert;

const VCO_MIN: u32 = 150_000_000;
const VCO_MAX: u32 = 420_000_000;
Expand Down

0 comments on commit 0b8e456

Please sign in to comment.