mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-10-01 01:26:06 -04:00
Tweak BasebandConfiguration constructors to avoid surprise type conversions.
This commit is contained in:
parent
f369885062
commit
83bf2a9a36
@ -126,11 +126,7 @@ void ReceiverModel::enable() {
|
|||||||
void ReceiverModel::disable() {
|
void ReceiverModel::disable() {
|
||||||
/* TODO: This is a dumb hack to stop baseband from working so hard. */
|
/* TODO: This is a dumb hack to stop baseband from working so hard. */
|
||||||
BasebandConfigurationMessage message {
|
BasebandConfigurationMessage message {
|
||||||
.configuration = {
|
.configuration = { },
|
||||||
.mode = -1,
|
|
||||||
.sampling_rate = 0,
|
|
||||||
.decimation_factor = 1,
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
shared_memory.baseband_queue.push(message);
|
shared_memory.baseband_queue.push(message);
|
||||||
|
|
||||||
|
@ -167,14 +167,19 @@ struct BasebandConfiguration {
|
|||||||
size_t decimation_factor;
|
size_t decimation_factor;
|
||||||
|
|
||||||
constexpr BasebandConfiguration(
|
constexpr BasebandConfiguration(
|
||||||
int32_t mode = -1,
|
int32_t mode,
|
||||||
uint32_t sampling_rate = 0,
|
uint32_t sampling_rate,
|
||||||
size_t decimation_factor = 1
|
size_t decimation_factor = 1
|
||||||
) : mode { mode },
|
) : mode { mode },
|
||||||
sampling_rate { sampling_rate },
|
sampling_rate { sampling_rate },
|
||||||
decimation_factor { decimation_factor }
|
decimation_factor { decimation_factor }
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constexpr BasebandConfiguration(
|
||||||
|
) : BasebandConfiguration { -1, 0, 1 }
|
||||||
|
{
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class BasebandConfigurationMessage : public Message {
|
class BasebandConfigurationMessage : public Message {
|
||||||
|
Loading…
Reference in New Issue
Block a user