fix: etherdream: use sleep instead of ping
This commit is contained in:
parent
650a3ed521
commit
89d38f51ec
@ -169,18 +169,19 @@ impl Device for EtherdreamDevice {
|
||||
line: Vec<Point>,
|
||||
_speed: u32,
|
||||
) -> LJResult<()> {
|
||||
let chunk_size = 111;
|
||||
let chunk_size = 512;
|
||||
let points_iter = line.into_iter();
|
||||
for chunk in points_iter.as_slice().chunks(chunk_size) {
|
||||
debug!("New chunk length: {:?}", chunk.len());
|
||||
let capacity = self.points_capacity();
|
||||
debug!("capacity : {:?}", capacity);
|
||||
loop {
|
||||
let capacity = self.points_capacity();
|
||||
debug!("capacity : {:?}", capacity);
|
||||
if chunk.len() > capacity as usize {
|
||||
debug!("Sleep");
|
||||
// Sleep for 1/100th of a sec
|
||||
sleep(Duration::new(0, 10_000_000));
|
||||
self.ping();
|
||||
sleep(Duration::new(0, 100_000_000));
|
||||
break;
|
||||
// self.ping();
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user