dds: inline

close #407
This commit is contained in:
Robert Jördens 2021-07-28 07:37:35 +00:00
parent bf0afc8a88
commit 1787daacaa
2 changed files with 4 additions and 0 deletions

View File

@ -562,6 +562,7 @@ impl ProfileSerializer {
/// * `acr` - If provided, indicates the amplitude control register for the channels. The ACR
/// should be stored in the 3 LSB of the word. Note that if amplitude scaling is to be used,
/// the "Amplitude multiplier enable" bit must be set.
#[inline]
pub fn update_channels(
&mut self,
channels: &[Channel],
@ -597,6 +598,7 @@ impl ProfileSerializer {
self.index += value.len() + 1;
}
#[inline]
fn pad(&mut self) {
// Pad the buffer to 32-bit (4 byte) alignment by adding dummy writes to CSR and LSRR.
match self.index & 3 {
@ -621,6 +623,7 @@ impl ProfileSerializer {
///
/// # Returns
/// A slice of `u32` words representing the serialized profile.
#[inline]
pub fn finalize<'a>(&'a mut self) -> &'a [u32] {
self.pad();
unsafe {

View File

@ -162,6 +162,7 @@ impl<'a> ProfileBuilder<'a> {
/// Write the profile to the DDS asynchronously.
#[allow(dead_code)]
#[inline]
pub fn write_profile(mut self) {
let profile = self.serializer.finalize();
self.dds_output.write_profile(profile);