mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-12-24 14:59:24 -05:00
Bracket BasebandThread loop with enable/disable code.
This commit is contained in:
parent
9188bb9ee9
commit
bb32ef5321
@ -101,6 +101,10 @@ void BasebandThread::run() {
|
||||
);
|
||||
//baseband::dma::allocate(4, 2048);
|
||||
|
||||
baseband_sgpio.configure(direction());
|
||||
baseband::dma::enable(direction());
|
||||
baseband_sgpio.streaming_enable();
|
||||
|
||||
while( !chThdShouldTerminate() ) {
|
||||
// TODO: Place correct sampling rate into buffer returned here:
|
||||
const auto buffer_tmp = baseband::dma::wait_for_rx_buffer();
|
||||
@ -114,6 +118,10 @@ void BasebandThread::run() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
i2s::i2s0::tx_mute();
|
||||
baseband::dma::disable();
|
||||
baseband_sgpio.streaming_disable();
|
||||
}
|
||||
|
||||
BasebandProcessor* BasebandThread::create_processor(const int32_t mode) {
|
||||
@ -129,19 +137,3 @@ BasebandProcessor* BasebandThread::create_processor(const int32_t mode) {
|
||||
default: return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void BasebandThread::disable() {
|
||||
if( baseband_processor ) {
|
||||
i2s::i2s0::tx_mute();
|
||||
baseband::dma::disable();
|
||||
baseband_sgpio.streaming_disable();
|
||||
}
|
||||
}
|
||||
|
||||
void BasebandThread::enable() {
|
||||
if( baseband_processor ) {
|
||||
baseband_sgpio.configure(direction());
|
||||
baseband::dma::enable(direction());
|
||||
baseband_sgpio.streaming_enable();
|
||||
}
|
||||
}
|
||||
|
@ -52,9 +52,6 @@ private:
|
||||
|
||||
BasebandProcessor* create_processor(const int32_t mode);
|
||||
|
||||
void disable();
|
||||
void enable();
|
||||
|
||||
void set_configuration(const BasebandConfiguration& new_configuration);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user