mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-07-29 17:49:14 -04:00
Move init/configure details into RSSI/BasebandThread classes.
This commit is contained in:
parent
ed25f65e8b
commit
818790e734
3 changed files with 20 additions and 20 deletions
|
@ -29,15 +29,10 @@
|
|||
|
||||
#include "gpdma.hpp"
|
||||
|
||||
#include "baseband_dma.hpp"
|
||||
|
||||
#include "event_m4.hpp"
|
||||
|
||||
#include "irq_ipc_m4.hpp"
|
||||
|
||||
#include "rssi.hpp"
|
||||
#include "rssi_dma.hpp"
|
||||
|
||||
#include "touch_dma.hpp"
|
||||
|
||||
#include "baseband_thread.hpp"
|
||||
|
@ -101,9 +96,6 @@ static void init() {
|
|||
gpdma::controller.enable();
|
||||
nvicEnableVector(DMA_IRQn, CORTEX_PRIORITY_MASK(LPC_DMA_IRQ_PRIORITY));
|
||||
|
||||
baseband::dma::init();
|
||||
|
||||
rf::rssi::init();
|
||||
touch::dma::init();
|
||||
}
|
||||
|
||||
|
@ -199,25 +191,14 @@ int main(void) {
|
|||
);
|
||||
|
||||
/* TODO: Ensure DMAs are configured to point at first LLI in chain. */
|
||||
|
||||
baseband_thread.thread_main = chThdSelf();
|
||||
baseband_thread.thread_rssi = rssi_thread.start(NORMALPRIO + 10);
|
||||
baseband_thread.start(NORMALPRIO + 20);
|
||||
|
||||
if( baseband_thread.direction() == baseband::Direction::Receive ) {
|
||||
rf::rssi::dma::allocate(4, 400);
|
||||
}
|
||||
|
||||
touch::dma::allocate();
|
||||
touch::dma::enable();
|
||||
|
||||
const auto baseband_buffer =
|
||||
new std::array<baseband::sample_t, 8192>();
|
||||
baseband::dma::configure(
|
||||
baseband_buffer->data(),
|
||||
baseband_thread.direction()
|
||||
);
|
||||
//baseband::dma::allocate(4, 2048);
|
||||
|
||||
event_dispatcher.run();
|
||||
|
||||
shutdown();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue