mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-11-27 07:06:28 -05:00
Formatted code (#1007)
* Updated style * Updated files * fixed new line * Updated spacing * File fix WIP * Updated to clang 13 * updated comment style * Removed old comment code
This commit is contained in:
parent
7aca7ce74d
commit
033c4e9a5b
599 changed files with 70746 additions and 66896 deletions
|
|
@ -33,42 +33,39 @@ WORKING_AREA(rssi_thread_wa, 128);
|
|||
Thread* RSSIThread::thread = nullptr;
|
||||
|
||||
RSSIThread::RSSIThread(const tprio_t priority) {
|
||||
thread = chThdCreateStatic(rssi_thread_wa, sizeof(rssi_thread_wa),
|
||||
priority, ThreadBase::fn,
|
||||
this
|
||||
);
|
||||
thread = chThdCreateStatic(rssi_thread_wa, sizeof(rssi_thread_wa),
|
||||
priority, ThreadBase::fn,
|
||||
this);
|
||||
}
|
||||
|
||||
RSSIThread::~RSSIThread() {
|
||||
chThdTerminate(thread);
|
||||
chThdWait(thread);
|
||||
thread = nullptr;
|
||||
chThdTerminate(thread);
|
||||
chThdWait(thread);
|
||||
thread = nullptr;
|
||||
}
|
||||
|
||||
void RSSIThread::run() {
|
||||
rf::rssi::init();
|
||||
rf::rssi::dma::allocate(4, 400);
|
||||
rf::rssi::init();
|
||||
rf::rssi::dma::allocate(4, 400);
|
||||
|
||||
RSSIStatisticsCollector stats;
|
||||
RSSIStatisticsCollector stats;
|
||||
|
||||
rf::rssi::start();
|
||||
rf::rssi::start();
|
||||
|
||||
while( !chThdShouldTerminate() ) {
|
||||
// TODO: Place correct sampling rate into buffer returned here:
|
||||
const auto buffer_tmp = rf::rssi::dma::wait_for_buffer();
|
||||
const rf::rssi::buffer_t buffer {
|
||||
buffer_tmp.p, buffer_tmp.count, sampling_rate
|
||||
};
|
||||
while (!chThdShouldTerminate()) {
|
||||
// TODO: Place correct sampling rate into buffer returned here:
|
||||
const auto buffer_tmp = rf::rssi::dma::wait_for_buffer();
|
||||
const rf::rssi::buffer_t buffer{
|
||||
buffer_tmp.p, buffer_tmp.count, sampling_rate};
|
||||
|
||||
stats.process(
|
||||
buffer,
|
||||
[](const RSSIStatistics& statistics) {
|
||||
const RSSIStatisticsMessage message { statistics };
|
||||
shared_memory.application_queue.push(message);
|
||||
}
|
||||
);
|
||||
}
|
||||
stats.process(
|
||||
buffer,
|
||||
[](const RSSIStatistics& statistics) {
|
||||
const RSSIStatisticsMessage message{statistics};
|
||||
shared_memory.application_queue.push(message);
|
||||
});
|
||||
}
|
||||
|
||||
rf::rssi::stop();
|
||||
rf::rssi::dma::free();
|
||||
rf::rssi::stop();
|
||||
rf::rssi::dma::free();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue