Compare commits
No commits in common. "51913f2e2f45d4c3e266e9ab9b1345d301221956" and "3ba8b99084a0f5fbac07cb9a6b6b822228dcfb39" have entirely different histories.
51913f2e2f
...
3ba8b99084
|
@ -878,6 +878,7 @@ dependencies = [
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"heapless 0.8.0",
|
"heapless 0.8.0",
|
||||||
|
"log",
|
||||||
"managed",
|
"managed",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ cortex-m-log = { version = "0.7.0", features = ["log-integration", "semihosting"
|
||||||
stm32f4xx-hal = { version = "0.20.0", features = ["stm32f407", "otg-fs", "usb_fs"] }
|
stm32f4xx-hal = { version = "0.20.0", features = ["stm32f407", "otg-fs", "usb_fs"] }
|
||||||
stm32-eth = { version = "0.6.0", features = ["stm32f407", "smoltcp-phy", "smoltcp"] }
|
stm32-eth = { version = "0.6.0", features = ["stm32f407", "smoltcp-phy", "smoltcp"] }
|
||||||
ieee802_3_miim = "0.8.0"
|
ieee802_3_miim = "0.8.0"
|
||||||
smoltcp = { version = "0.11.0", default-features = false, features = ["proto-ipv4", "socket-tcp", "medium-ethernet", "iface-neighbor-cache-count-16"] }
|
smoltcp = { version = "0.11.0", default-features = false, features = ["proto-ipv4", "socket-tcp", "log", "medium-ethernet", "iface-neighbor-cache-count-16"] }
|
||||||
uom = { version = "0.30", default-features = false, features = ["autoconvert", "si", "f32", "use_serde"] }
|
uom = { version = "0.30", default-features = false, features = ["autoconvert", "si", "f32", "use_serde"] }
|
||||||
num-traits = { version = "0.2.15", default-features = false, features = ["libm"] }
|
num-traits = { version = "0.2.15", default-features = false, features = ["libm"] }
|
||||||
usb-device = "0.3.2"
|
usb-device = "0.3.2"
|
||||||
|
|
|
@ -835,15 +835,11 @@ class Kirdy:
|
||||||
self._connected_sig.emit(True)
|
self._connected_sig.emit(True)
|
||||||
|
|
||||||
async def _read_response(self, buffer_size=16384):
|
async def _read_response(self, buffer_size=16384):
|
||||||
raw_response = b''
|
raw_response = await self._reader.read(buffer_size)
|
||||||
while len(raw_response) == 0:
|
|
||||||
# Ignore 0 size packet
|
|
||||||
raw_response = await self._reader.read(buffer_size)
|
|
||||||
response = raw_response.decode('utf-8', errors='ignore').split("\n")
|
response = raw_response.decode('utf-8', errors='ignore').split("\n")
|
||||||
response = response[:-1]
|
response.reverse()
|
||||||
|
|
||||||
items = []
|
items = []
|
||||||
for item in response:
|
for item in response[1:]:
|
||||||
items.append(json.loads(item))
|
items.append(json.loads(item))
|
||||||
return items
|
return items
|
||||||
|
|
||||||
|
|
|
@ -220,9 +220,7 @@ impl ServerHandle {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn poll_iface(&mut self) {
|
pub fn poll_iface(&mut self) {
|
||||||
cortex_m::interrupt::free(|_| {
|
self.iface.poll(now_fn(), &mut &mut self.dma, &mut self.socket_set);
|
||||||
self.iface.poll(now_fn(), &mut &mut self.dma, &mut self.socket_set);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn poll_at_iface(&mut self) -> Option<Instant> {
|
pub fn poll_at_iface(&mut self) -> Option<Instant> {
|
||||||
|
@ -248,7 +246,8 @@ impl ServerHandle {
|
||||||
if num_bytes > 0 {
|
if num_bytes > 0 {
|
||||||
match socket.send_slice(&buffer[..num_bytes]) {
|
match socket.send_slice(&buffer[..num_bytes]) {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
info!("Enqueued {} bytes.", num_bytes);
|
self.poll_iface();
|
||||||
|
info!("Sent {} bytes.", num_bytes);
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
info!("Bytes cannot be sent. Error: {:?}", err)
|
info!("Bytes cannot be sent. Error: {:?}", err)
|
||||||
|
@ -516,9 +515,11 @@ pub fn for_each<F: FnMut(SocketHandle, usize)>(mut callback: F) {
|
||||||
#[interrupt]
|
#[interrupt]
|
||||||
fn ETH() {
|
fn ETH() {
|
||||||
let interrupt_reason = stm32_eth::eth_interrupt_handler();
|
let interrupt_reason = stm32_eth::eth_interrupt_handler();
|
||||||
if interrupt_reason.rx {
|
cortex_m::interrupt::free(|_| {
|
||||||
eth_poll_iface();
|
if interrupt_reason.rx {
|
||||||
}
|
eth_poll_iface();
|
||||||
|
}
|
||||||
|
});
|
||||||
debug!("Ethernet Interrupt{:?}", interrupt_reason);
|
debug!("Ethernet Interrupt{:?}", interrupt_reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue