Skip to content

Commit 4bdd121

Browse files
committed
Merge branch 'develop'
2 parents 50d4c13 + 86f1a7a commit 4bdd121

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+2763
-1600
lines changed

.github/actions/setup-build/action.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,22 @@ inputs:
1212
description: 'arch'
1313
required: false
1414
default: ''
15+
toolchain:
16+
description: 'toolchain'
17+
required: false
18+
default: 'stable'
1519
runs:
1620
using: "composite"
1721
steps:
1822
- name: Setup Python
1923
uses: actions/setup-python@v4
2024
with:
2125
python-version: "3.12"
26+
27+
- name: Setup Rust
28+
uses: actions-rust-lang/setup-rust-toolchain@v1
29+
with:
30+
toolchain: ${{ inputs.toolchain }}
2231

2332
- name: Install Protoc
2433
uses: arduino/setup-protoc@v2

.github/workflows/build.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@ jobs:
3737

3838
steps:
3939
- uses: actions/checkout@v3
40-
41-
- name: Rust cache
42-
if: needs.check-src.outputs.status
43-
uses: swatinem/rust-cache@v2
4440

4541
- name: Setup
4642
if: needs.check-src.outputs.status
4743
uses: ./.github/actions/setup-build
4844
with:
4945
github-token: ${{ secrets.GITHUB_TOKEN }}
5046
os: ${{ matrix.os }}
47+
48+
- name: Rust cache
49+
if: needs.check-src.outputs.status
50+
uses: swatinem/rust-cache@v2
5151

5252
- name: Test src on ${{ matrix.os }}
5353
if: needs.check-src.outputs.status
@@ -69,17 +69,17 @@ jobs:
6969
steps:
7070
- uses: actions/checkout@v3
7171

72-
- name: Rust cache
73-
if: needs.check-src.outputs.status
74-
uses: swatinem/rust-cache@v2
75-
7672
- name: Setup
7773
if: needs.check-src.outputs.status
7874
uses: ./.github/actions/setup-build
7975
with:
8076
github-token: ${{ secrets.GITHUB_TOKEN }}
8177
os: ${{ matrix.os }}
8278

79+
- name: Rust cache
80+
if: needs.check-src.outputs.status
81+
uses: swatinem/rust-cache@v2
82+
8383
- name: Test src for unity on ${{ matrix.os }}
8484
if: needs.check-src.outputs.status
8585
run: |

.github/workflows/coverage.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ jobs:
3636
with:
3737
github-token: ${{ secrets.GITHUB_TOKEN }}
3838
os: ubuntu-latest
39-
- uses: dtolnay/rust-toolchain@nightly
39+
toolchain: nightly
40+
4041
- name: Install cargo-llvm-cov
4142
uses: taiki-e/install-action@cargo-llvm-cov
4243

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
# 19.1.1
1+
# 20.0.0
22

3+
- Update firmware to v5.0.0
4+
- Add fixed completion steps algorithm of Silencer
35
- Fix `T4010A1_AMPLITUDE` value
6+
- Add calculation of index of Modulation and STM from system time in firmware-emulator
47

58
# 19.1.0
69

autd3-derive/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "autd3-derive"
3-
version = "19.1.1"
3+
version = "20.0.0"
44
authors = ["shun suzuki <suzuki@hapis.k.u-tokyo.ac.jp>"]
55
edition = "2021"
66

autd3-derive/src/lib.rs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Created Date: 28/04/2022
55
* Author: Shun Suzuki
66
* -----
7-
* Last Modified: 13/12/2023
7+
* Last Modified: 30/12/2023
88
* Modified By: Shun Suzuki (suzuki@hapis.k.u-tokyo.ac.jp)
99
* -----
1010
* Copyright (c) 2022-2023 Shun Suzuki. All rights reserved.
@@ -82,6 +82,10 @@ pub fn modulation_derive(input: TokenStream) -> TokenStream {
8282
let freq_div = self.config.frequency_division();
8383
Ok((Self::O1::new(self.calc()?, freq_div), Self::O2::default()))
8484
}
85+
86+
fn timeout(&self) -> Option<std::time::Duration> {
87+
Some(std::time::Duration::from_millis(200))
88+
}
8589
}
8690
};
8791
gen.into()
@@ -136,7 +140,6 @@ pub fn link_derive(input: TokenStream) -> TokenStream {
136140
let type_params_impl = generics.type_params();
137141

138142
let gen = quote! {
139-
#[async_trait::async_trait]
140143
impl <#(#type_params_impl,)*> autd3_driver::link::Link for #name #ty_generics_impl #where_clause_impl{
141144
async fn close(&mut self) -> Result<(), autd3_driver::error::AUTDInternalError> {
142145
<Self as autd3_driver::link::LinkSync>::close(self)
@@ -158,20 +161,21 @@ pub fn link_derive(input: TokenStream) -> TokenStream {
158161
tx: &autd3_driver::cpu::TxDatagram,
159162
rx: &mut [autd3_driver::cpu::RxMessage],
160163
timeout: Option<std::time::Duration>,
164+
ignore_ack: bool,
161165
) -> Result<bool, autd3_driver::error::AUTDInternalError> {
162-
<Self as autd3_driver::link::LinkSync>::send_receive(self, tx, rx, timeout)
166+
<Self as autd3_driver::link::LinkSync>::send_receive(self, tx, rx, timeout, ignore_ack)
163167
}
164168
async fn wait_msg_processed(
165169
&mut self,
166170
tx: &autd3_driver::cpu::TxDatagram,
167171
rx: &mut [autd3_driver::cpu::RxMessage],
168172
timeout: std::time::Duration,
173+
ignore_ack: bool,
169174
) -> Result<bool, autd3_driver::error::AUTDInternalError> {
170-
<Self as autd3_driver::link::LinkSync>::wait_msg_processed(self, tx, rx, timeout)
175+
<Self as autd3_driver::link::LinkSync>::wait_msg_processed(self, tx, rx, timeout, ignore_ack)
171176
}
172177
}
173178

174-
#[async_trait::async_trait]
175179
impl<#(#type_params_open,)*> autd3_driver::link::LinkBuilder for #name_builder #ty_generics_open #where_clause_open {
176180
type L = #name #ty_generics_open;
177181

@@ -237,18 +241,20 @@ pub fn link_sync_derive(input: TokenStream) -> TokenStream {
237241
tx: &autd3_driver::cpu::TxDatagram,
238242
rx: &mut [autd3_driver::cpu::RxMessage],
239243
timeout: Option<std::time::Duration>,
244+
ignore_ack: bool,
240245
) -> Result<bool, autd3_driver::error::AUTDInternalError> {
241246
self.runtime
242-
.block_on(self.inner.send_receive(tx, rx, timeout))
247+
.block_on(self.inner.send_receive(tx, rx, timeout, ignore_ack))
243248
}
244249
fn wait_msg_processed(
245250
&mut self,
246251
tx: &autd3_driver::cpu::TxDatagram,
247252
rx: &mut [autd3_driver::cpu::RxMessage],
248253
timeout: std::time::Duration,
254+
ignore_ack: bool,
249255
) -> Result<bool, autd3_driver::error::AUTDInternalError> {
250256
self.runtime
251-
.block_on(self.inner.wait_msg_processed(tx, rx, timeout))
257+
.block_on(self.inner.wait_msg_processed(tx, rx, timeout, ignore_ack))
252258
}
253259
}
254260

autd3-driver/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "autd3-driver"
3-
version = "19.1.1"
3+
version = "20.0.0"
44
authors = ["shun suzuki <suzuki@hapis.k.u-tokyo.ac.jp>"]
55
edition = "2021"
66

@@ -16,7 +16,6 @@ bitflags = "2.0.2"
1616
thiserror = "1.0.31"
1717
nalgebra = { version = "0.32.3", default-features = false, features = ["std"] }
1818
bitvec = "1.0.1"
19-
async-trait = "0.1.74"
2019

2120
[target.'cfg(windows)'.dependencies]
2221
windows = { version = "0.52.0", features = ["Win32_Media_Multimedia", "Win32_System_Threading", "Win32_Foundation"] }

autd3-driver/src/autd3_device.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Created Date: 06/12/2022
55
* Author: Shun Suzuki
66
* -----
7-
* Last Modified: 01/12/2023
7+
* Last Modified: 29/12/2023
88
* Modified By: Shun Suzuki (suzuki@hapis.k.u-tokyo.ac.jp)
99
* -----
1010
* Copyright (c) 2023 Shun Suzuki. All rights reserved.
@@ -71,6 +71,9 @@ impl AUTD3 {
7171
Ok(v) => v,
7272
Err(_) => return true,
7373
};
74+
if 17 < x || 14 < y {
75+
return true;
76+
}
7477

7578
y == 1 && (x == 1 || x == 2 || x == 16)
7679
}
@@ -431,6 +434,12 @@ mod tests {
431434
assert!(!AUTD3::is_missing_transducer(16, 13));
432435
assert!(!AUTD3::is_missing_transducer(17, 13));
433436

437+
for x in 18..=255 {
438+
for y in 14..=255 {
439+
assert!(AUTD3::is_missing_transducer(x, y));
440+
}
441+
}
442+
434443
assert!(!AUTD3::is_missing_transducer(0i8, 0i8));
435444
assert!(!AUTD3::is_missing_transducer(0i16, 0i16));
436445
assert!(!AUTD3::is_missing_transducer(0i32, 0i32));

autd3-driver/src/common/emit_intensity.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Created Date: 11/11/2023
55
* Author: Shun Suzuki
66
* -----
7-
* Last Modified: 02/12/2023
7+
* Last Modified: 30/12/2023
88
* Modified By: Shun Suzuki (suzuki@hapis.k.u-tokyo.ac.jp)
99
* -----
1010
* Copyright (c) 2023 Shun Suzuki. All rights reserved.
@@ -24,7 +24,7 @@ impl EmitIntensity {
2424
pub const MIN: EmitIntensity = EmitIntensity { value: 0 };
2525
pub const DEFAULT_CORRECTED_ALPHA: float = 0.803;
2626

27-
pub fn new(value: u8) -> Self {
27+
pub const fn new(value: u8) -> Self {
2828
Self { value }
2929
}
3030

@@ -38,7 +38,7 @@ impl EmitIntensity {
3838
}
3939
}
4040

41-
pub fn value(&self) -> u8 {
41+
pub const fn value(&self) -> u8 {
4242
self.value
4343
}
4444
}

autd3-driver/src/common/phase.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Created Date: 02/12/2023
55
* Author: Shun Suzuki
66
* -----
7-
* Last Modified: 02/12/2023
7+
* Last Modified: 30/12/2023
88
* Modified By: Shun Suzuki (suzuki@hapis.k.u-tokyo.ac.jp)
99
* -----
1010
* Copyright (c) 2023 Shun Suzuki. All rights reserved.
@@ -21,7 +21,7 @@ pub struct Phase {
2121
}
2222

2323
impl Phase {
24-
pub fn new(value: u8) -> Self {
24+
pub const fn new(value: u8) -> Self {
2525
Self { value }
2626
}
2727

@@ -31,7 +31,7 @@ impl Phase {
3131
}
3232
}
3333

34-
pub fn value(&self) -> u8 {
34+
pub const fn value(&self) -> u8 {
3535
self.value
3636
}
3737

autd3-driver/src/cpu/datagram/tx.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Created Date: 29/08/2023
55
* Author: Shun Suzuki
66
* -----
7-
* Last Modified: 06/12/2023
7+
* Last Modified: 30/12/2023
88
* Modified By: Shun Suzuki (suzuki@hapis.k.u-tokyo.ac.jp)
99
* -----
1010
* Copyright (c) 2023 Shun Suzuki. All rights reserved.
@@ -27,7 +27,7 @@ impl TxDatagram {
2727
}
2828
}
2929

30-
pub fn num_devices(&self) -> usize {
30+
pub const fn num_devices(&self) -> usize {
3131
self.num_devices
3232
}
3333

autd3-driver/src/cpu/header.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,18 @@
44
* Created Date: 02/05/2022
55
* Author: Shun Suzuki
66
* -----
7-
* Last Modified: 06/12/2023
7+
* Last Modified: 30/12/2023
88
* Modified By: Shun Suzuki (suzuki@hapis.k.u-tokyo.ac.jp)
99
* -----
1010
* Copyright (c) 2022-2023 Shun Suzuki. All rights reserved.
1111
*
1212
*/
1313

14+
pub const MSG_ID_MAX: u8 = 0x7F;
15+
1416
#[repr(C)]
1517
pub struct Header {
1618
pub msg_id: u8,
17-
pub _fpga_flag: u8, // only used before v4.1.0
19+
_pad: u8,
1820
pub slot_2_offset: u16,
1921
}

autd3-driver/src/datagram/debug.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Created Date: 21/11/2023
55
* Author: Shun Suzuki
66
* -----
7-
* Last Modified: 02/12/2023
7+
* Last Modified: 30/12/2023
88
* Modified By: Shun Suzuki (suzuki@hapis.k.u-tokyo.ac.jp)
99
* -----
1010
* Copyright (c) 2023 Shun Suzuki. All rights reserved.
@@ -22,7 +22,7 @@ pub struct ConfigureDebugOutputIdx<F: Fn(&Device) -> Option<&Transducer>> {
2222

2323
impl<F: Fn(&Device) -> Option<&Transducer>> ConfigureDebugOutputIdx<F> {
2424
/// constructor
25-
pub fn new(f: F) -> Self {
25+
pub const fn new(f: F) -> Self {
2626
Self { f }
2727
}
2828
}

autd3-driver/src/datagram/force_fan.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Created Date: 06/12/2023
55
* Author: Shun Suzuki
66
* -----
7-
* Last Modified: 06/12/2023
7+
* Last Modified: 30/12/2023
88
* Modified By: Shun Suzuki (suzuki@hapis.k.u-tokyo.ac.jp)
99
* -----
1010
* Copyright (c) 2023 Shun Suzuki. All rights reserved.
@@ -20,7 +20,7 @@ pub struct ConfigureForceFan<F: Fn(&Device) -> bool> {
2020

2121
impl<F: Fn(&Device) -> bool> ConfigureForceFan<F> {
2222
/// constructor
23-
pub fn new(f: F) -> Self {
23+
pub const fn new(f: F) -> Self {
2424
Self { f }
2525
}
2626
}

autd3-driver/src/datagram/mod.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Created Date: 29/09/2023
55
* Author: Shun Suzuki
66
* -----
7-
* Last Modified: 13/12/2023
7+
* Last Modified: 26/12/2023
88
* Modified By: Shun Suzuki (suzuki@hapis.k.u-tokyo.ac.jp)
99
* -----
1010
* Copyright (c) 2023 Shun Suzuki. All rights reserved.
@@ -20,7 +20,6 @@ mod modulation;
2020
mod reads_fpga_info;
2121
mod silencer;
2222
mod stm;
23-
mod stop;
2423
mod synchronize;
2524
mod with_timeout;
2625

@@ -31,10 +30,8 @@ pub use gain::{Gain, GainAsAny, GainFilter};
3130
pub use mod_delay::ConfigureModDelay;
3231
pub use modulation::{Modulation, ModulationProperty};
3332
pub use reads_fpga_info::ConfigureReadsFPGAInfo;
34-
pub use silencer::Silencer;
33+
pub use silencer::ConfigureSilencer;
3534
pub use stm::{FocusSTM, GainSTM, STMProps};
36-
#[allow(deprecated)]
37-
pub use stop::Stop;
3835
pub use synchronize::Synchronize;
3936
pub use with_timeout::{DatagramT, DatagramWithTimeout};
4037

autd3-driver/src/datagram/reads_fpga_info.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Created Date: 06/12/2023
55
* Author: Shun Suzuki
66
* -----
7-
* Last Modified: 06/12/2023
7+
* Last Modified: 30/12/2023
88
* Modified By: Shun Suzuki (suzuki@hapis.k.u-tokyo.ac.jp)
99
* -----
1010
* Copyright (c) 2023 Shun Suzuki. All rights reserved.
@@ -20,7 +20,7 @@ pub struct ConfigureReadsFPGAInfo<F: Fn(&Device) -> bool> {
2020

2121
impl<F: Fn(&Device) -> bool> ConfigureReadsFPGAInfo<F> {
2222
/// constructor
23-
pub fn new(f: F) -> Self {
23+
pub const fn new(f: F) -> Self {
2424
Self { f }
2525
}
2626
}

0 commit comments

Comments
 (0)