mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-12-25 15:29:37 -05:00
Clean up buffer_t constructors.
This commit is contained in:
parent
d96379dc9c
commit
435824e9b5
@ -169,10 +169,10 @@ baseband::buffer_t wait_for_rx_buffer() {
|
|||||||
const size_t free_index = (next_index + transfers_per_buffer - 2) & transfers_mask;
|
const size_t free_index = (next_index + transfers_per_buffer - 2) & transfers_mask;
|
||||||
return { reinterpret_cast<sample_t*>(lli_loop[free_index].destaddr), transfer_samples };
|
return { reinterpret_cast<sample_t*>(lli_loop[free_index].destaddr), transfer_samples };
|
||||||
} else {
|
} else {
|
||||||
return { nullptr, 0 };
|
return { };
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return { nullptr, 0 };
|
return { };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,18 +32,24 @@ struct buffer_t {
|
|||||||
const uint32_t sampling_rate;
|
const uint32_t sampling_rate;
|
||||||
|
|
||||||
constexpr buffer_t(
|
constexpr buffer_t(
|
||||||
T* const p,
|
) : p { nullptr },
|
||||||
const size_t count
|
count { 0 },
|
||||||
) : p { p },
|
|
||||||
count { count },
|
|
||||||
sampling_rate { 0 }
|
sampling_rate { 0 }
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constexpr buffer_t(
|
||||||
|
const buffer_t<T>& other
|
||||||
|
) : p { other.p },
|
||||||
|
count { other.count },
|
||||||
|
sampling_rate { other.sampling_rate }
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
constexpr buffer_t(
|
constexpr buffer_t(
|
||||||
T* const p,
|
T* const p,
|
||||||
const size_t count,
|
const size_t count,
|
||||||
const uint32_t sampling_rate
|
const uint32_t sampling_rate = 0
|
||||||
) : p { p },
|
) : p { p },
|
||||||
count { count },
|
count { count },
|
||||||
sampling_rate { sampling_rate }
|
sampling_rate { sampling_rate }
|
||||||
|
Loading…
Reference in New Issue
Block a user