diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2023-01-07 17:11:36 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2023-01-07 17:11:36 +0100 |
commit | c00dbb4579b98e248e99d546268782fa0f72bff0 (patch) | |
tree | a0488e069212c6354c749e4243c80664dc39179d /src | |
parent | dd2390c7e7331a8dcdabcd16fbdc603a78609536 (diff) | |
download | fl2k_ampliphase-c00dbb4579b98e248e99d546268782fa0f72bff0.tar.gz fl2k_ampliphase-c00dbb4579b98e248e99d546268782fa0f72bff0.tar.bz2 fl2k_ampliphase-c00dbb4579b98e248e99d546268782fa0f72bff0.zip |
Handle set_sample_rate
Diffstat (limited to 'src')
-rw-r--r-- | src/fl2k.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/fl2k.rs b/src/fl2k.rs index 74357b3..a17a04d 100644 --- a/src/fl2k.rs +++ b/src/fl2k.rs @@ -95,7 +95,13 @@ impl FL2K { } pub fn set_sample_rate(&mut self, sample_rate: u32) -> Result<(), FL2KError> { - handle_return_value( unsafe { fl2k_set_sample_rate(self.device, sample_rate) }) + let r = unsafe { fl2k_set_sample_rate(self.device, sample_rate) }; + if r < 0 { + handle_return_value(r) + } + else { + Ok(()) + } } pub fn get_sample_rate(&mut self) -> Result<u32, FL2KError> { |