mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-09-10 16:49:36 +00:00
Move Thread WORKING_AREAs out of classes.
Limited where and how you could instantiate the classes.
This commit is contained in:
@@ -42,8 +42,10 @@
|
|||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
|
|
||||||
|
WORKING_AREA(baseband_thread_wa, 2048);
|
||||||
|
|
||||||
Thread* BasebandThread::start(const tprio_t priority) {
|
Thread* BasebandThread::start(const tprio_t priority) {
|
||||||
return chThdCreateStatic(wa, sizeof(wa),
|
return chThdCreateStatic(baseband_thread_wa, sizeof(baseband_thread_wa),
|
||||||
priority, ThreadBase::fn,
|
priority, ThreadBase::fn,
|
||||||
this
|
this
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -50,8 +50,6 @@ public:
|
|||||||
BasebandProcessor* baseband_processor { nullptr };
|
BasebandProcessor* baseband_processor { nullptr };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
WORKING_AREA(wa, 2048);
|
|
||||||
|
|
||||||
BasebandConfiguration baseband_configuration;
|
BasebandConfiguration baseband_configuration;
|
||||||
|
|
||||||
void run() override;
|
void run() override;
|
||||||
|
|||||||
@@ -74,9 +74,6 @@ void __late_init(void) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static BasebandThread baseband_thread;
|
|
||||||
static RSSIThread rssi_thread;
|
|
||||||
|
|
||||||
static void init() {
|
static void init() {
|
||||||
i2s::i2s0::configure(
|
i2s::i2s0::configure(
|
||||||
audio::i2s0_config_tx,
|
audio::i2s0_config_tx,
|
||||||
@@ -163,6 +160,8 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
MessageHandlerMap message_map;
|
MessageHandlerMap message_map;
|
||||||
|
BasebandThread baseband_thread;
|
||||||
|
RSSIThread rssi_thread;
|
||||||
|
|
||||||
bool is_running = true;
|
bool is_running = true;
|
||||||
|
|
||||||
|
|||||||
@@ -28,8 +28,10 @@
|
|||||||
#include "message.hpp"
|
#include "message.hpp"
|
||||||
#include "portapack_shared_memory.hpp"
|
#include "portapack_shared_memory.hpp"
|
||||||
|
|
||||||
|
WORKING_AREA(rssi_thread_wa, 128);
|
||||||
|
|
||||||
Thread* RSSIThread::start(const tprio_t priority) {
|
Thread* RSSIThread::start(const tprio_t priority) {
|
||||||
return chThdCreateStatic(wa, sizeof(wa),
|
return chThdCreateStatic(rssi_thread_wa, sizeof(rssi_thread_wa),
|
||||||
priority, ThreadBase::fn,
|
priority, ThreadBase::fn,
|
||||||
this
|
this
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -38,8 +38,6 @@ public:
|
|||||||
Thread* start(const tprio_t priority);
|
Thread* start(const tprio_t priority);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
WORKING_AREA(wa, 128);
|
|
||||||
|
|
||||||
void run() override;
|
void run() override;
|
||||||
|
|
||||||
const uint32_t sampling_rate { 400000 };
|
const uint32_t sampling_rate { 400000 };
|
||||||
|
|||||||
Reference in New Issue
Block a user