Skip to content

Commit 47e7bc0

Browse files
authored
Merge pull request #58 from Jim-Hodapp-Coaching/clean_up_imports
Clean up imports
2 parents 1af839e + 1a44b76 commit 47e7bc0

File tree

6 files changed

+31
-39
lines changed

6 files changed

+31
-39
lines changed

esp32-wroom-rp/src/lib.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,24 +84,23 @@
8484
#![warn(missing_docs)]
8585
#![cfg_attr(not(test), no_std)]
8686

87-
/// Fundamental interface for creating and send/receiving data to/from a TCP server.
88-
pub mod tcp_client;
89-
9087
pub mod gpio;
91-
/// Fundamental interface for controlling a connected ESP32-WROOM NINA firmware-based Wifi board.
92-
pub mod wifi;
93-
9488
/// Responsible for interactions over a WiFi network and also contains related types.
9589
pub mod network;
9690
/// Responsible for interactions with NINA firmware over a data bus.
9791
pub mod protocol;
92+
/// Fundamental interface for creating and send/receiving data to/from a TCP server.
93+
pub mod tcp_client;
94+
/// Fundamental interface for controlling a connected ESP32-WROOM NINA firmware-based Wifi board.
95+
pub mod wifi;
9896

9997
mod spi;
10098

99+
use defmt::{write, Format, Formatter};
100+
101101
use network::NetworkError;
102-
use protocol::ProtocolError;
103102

104-
use defmt::{write, Format, Formatter};
103+
use protocol::ProtocolError;
105104

106105
const ARRAY_LENGTH_PLACEHOLDER: usize = 8;
107106

esp32-wroom-rp/src/protocol.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
pub(crate) mod operation;
22

3-
use embedded_hal::blocking::delay::DelayMs;
3+
use core::cell::RefCell;
44

55
use defmt::{write, Format, Formatter};
66

7+
use embedded_hal::blocking::delay::DelayMs;
8+
79
use heapless::{String, Vec};
810

911
use super::network::{ConnectionState, IpAddress, Port, Socket, TransportMode};
1012
use super::wifi::ConnectionStatus;
1113
use super::{Error, FirmwareVersion, ARRAY_LENGTH_PLACEHOLDER};
1214

13-
use core::cell::RefCell;
14-
1515
pub(crate) const MAX_NINA_PARAM_LENGTH: usize = 4096;
1616

1717
#[repr(u8)]

esp32-wroom-rp/src/protocol/operation.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use crate::protocol::{NinaAbstractParam, NinaCommand};
2-
31
use heapless::Vec;
2+
3+
use super::{NinaAbstractParam, NinaCommand};
4+
45
const MAX_NUMBER_OF_PARAMS: usize = 6;
56

67
// Encapsulates all information needed to execute commands against Nina Firmware.

esp32-wroom-rp/src/spi.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
11
//! Serial Peripheral Interface (SPI) for Wifi
2+
use core::convert::Infallible;
23

3-
use crate::network::ConnectionState;
4+
use embedded_hal::blocking::delay::DelayMs;
5+
use embedded_hal::blocking::spi::Transfer;
46

57
use super::gpio::EspControlInterface;
8+
use super::network::{ConnectionState, IpAddress, NetworkError, Port, Socket, TransportMode};
9+
use super::protocol::operation::Operation;
610
use super::protocol::{
711
NinaByteParam, NinaCommand, NinaConcreteParam, NinaLargeArrayParam, NinaParam,
8-
NinaProtocolHandler, NinaSmallArrayParam, NinaWordParam, ProtocolInterface,
12+
NinaProtocolHandler, NinaSmallArrayParam, NinaWordParam, ProtocolError, ProtocolInterface,
913
};
10-
11-
use super::network::{IpAddress, NetworkError, Port, Socket, TransportMode};
12-
use super::protocol::{operation::Operation, ProtocolError};
1314
use super::wifi::ConnectionStatus;
1415
use super::{Error, FirmwareVersion, ARRAY_LENGTH_PLACEHOLDER};
1516

16-
use embedded_hal::blocking::delay::DelayMs;
17-
use embedded_hal::blocking::spi::Transfer;
18-
19-
use core::convert::Infallible;
20-
2117
// TODO: this should eventually move into NinaCommandHandler
2218
#[repr(u8)]
2319
#[derive(Debug)]

esp32-wroom-rp/src/tcp_client.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
use super::{Error, ARRAY_LENGTH_PLACEHOLDER};
2-
use crate::{network::NetworkError, wifi::Wifi};
3-
4-
use super::protocol::NinaProtocolHandler;
5-
use crate::gpio::EspControlInterface;
6-
use crate::protocol::ProtocolInterface;
7-
8-
use super::network::{ConnectionState, Hostname, IpAddress, Port, Socket, TransportMode};
9-
101
use embedded_hal::blocking::delay::DelayMs;
112
use embedded_hal::blocking::spi::Transfer;
123

134
use heapless::String;
145

6+
use super::gpio::EspControlInterface;
7+
use super::network::{
8+
ConnectionState, Hostname, IpAddress, NetworkError, Port, Socket, TransportMode,
9+
};
10+
use super::protocol::{NinaProtocolHandler, ProtocolInterface};
11+
use super::wifi::Wifi;
12+
use super::{Error, ARRAY_LENGTH_PLACEHOLDER};
13+
1514
const MAX_HOSTNAME_LENGTH: usize = 255;
1615

1716
/// Connect trait that allows for a `TcpClient` instance to connect to a remote

esp32-wroom-rp/src/wifi.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
1-
use embedded_hal::blocking::delay::DelayMs;
2-
use embedded_hal::blocking::spi::Transfer;
1+
use core::cell::RefCell;
32

43
use defmt::{write, Format, Formatter};
54

6-
use super::{Error, FirmwareVersion};
5+
use embedded_hal::blocking::{delay::DelayMs, spi::Transfer};
76

87
use super::gpio::EspControlInterface;
9-
use super::protocol::{NinaProtocolHandler, ProtocolInterface};
10-
11-
use core::cell::RefCell;
12-
138
use super::network::IpAddress;
9+
use super::protocol::{NinaProtocolHandler, ProtocolInterface};
10+
use super::{Error, FirmwareVersion};
1411

1512
/// An enumerated type that represents the current WiFi network connection status.
1613
#[repr(u8)]

0 commit comments

Comments
 (0)