mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-06-20 19:38:29 +00:00
Plumb BasebandThread to accept direction argument.
Default is to receive, for compatibility with existing users.
This commit is contained in:
parent
96da55d83a
commit
2ec1bab5d5
@ -44,9 +44,11 @@ Thread* BasebandThread::thread = nullptr;
|
|||||||
BasebandThread::BasebandThread(
|
BasebandThread::BasebandThread(
|
||||||
uint32_t sampling_rate,
|
uint32_t sampling_rate,
|
||||||
BasebandProcessor* const baseband_processor,
|
BasebandProcessor* const baseband_processor,
|
||||||
const tprio_t priority
|
const tprio_t priority,
|
||||||
|
baseband::Direction direction
|
||||||
) : baseband_processor { baseband_processor },
|
) : baseband_processor { baseband_processor },
|
||||||
sampling_rate { sampling_rate }
|
sampling_rate { sampling_rate },
|
||||||
|
_direction { direction }
|
||||||
{
|
{
|
||||||
thread = chThdCreateStatic(baseband_thread_wa, sizeof(baseband_thread_wa),
|
thread = chThdCreateStatic(baseband_thread_wa, sizeof(baseband_thread_wa),
|
||||||
priority, ThreadBase::fn,
|
priority, ThreadBase::fn,
|
||||||
|
@ -33,20 +33,22 @@ public:
|
|||||||
BasebandThread(
|
BasebandThread(
|
||||||
uint32_t sampling_rate,
|
uint32_t sampling_rate,
|
||||||
BasebandProcessor* const baseband_processor,
|
BasebandProcessor* const baseband_processor,
|
||||||
const tprio_t priority
|
const tprio_t priority,
|
||||||
|
const baseband::Direction direction = baseband::Direction::Receive
|
||||||
);
|
);
|
||||||
~BasebandThread();
|
~BasebandThread();
|
||||||
|
|
||||||
// This getter should die, it's just here to leak information to code that
|
// This getter should die, it's just here to leak information to code that
|
||||||
// isn't in the right place to begin with.
|
// isn't in the right place to begin with.
|
||||||
baseband::Direction direction() const {
|
baseband::Direction direction() const {
|
||||||
return baseband::Direction::Receive;
|
return _direction;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static Thread* thread;
|
static Thread* thread;
|
||||||
|
|
||||||
BasebandProcessor* baseband_processor { nullptr };
|
BasebandProcessor* baseband_processor { nullptr };
|
||||||
|
baseband::Direction _direction;
|
||||||
uint32_t sampling_rate;
|
uint32_t sampling_rate;
|
||||||
|
|
||||||
void run() override;
|
void run() override;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user