mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-02-23 08:09:58 -05:00
Rename EVT_FIFO_HIGHWATER -> EVT_MASK_CAPTURE_THREAD.
This commit is contained in:
parent
3103e9b80e
commit
c585f3d4ea
@ -78,7 +78,7 @@ public:
|
|||||||
if( thread_tmp ) {
|
if( thread_tmp ) {
|
||||||
thread = nullptr;
|
thread = nullptr;
|
||||||
chThdTerminate(thread_tmp);
|
chThdTerminate(thread_tmp);
|
||||||
chEvtSignal(thread_tmp, EVT_FIFO_HIGHWATER);
|
chEvtSignal(thread_tmp, EVT_MASK_CAPTURE_THREAD);
|
||||||
const auto success = chThdWait(thread_tmp);
|
const auto success = chThdWait(thread_tmp);
|
||||||
|
|
||||||
if( !success ) {
|
if( !success ) {
|
||||||
@ -91,13 +91,12 @@ public:
|
|||||||
// TODO: Prevent over-signalling by transmitting a set of
|
// TODO: Prevent over-signalling by transmitting a set of
|
||||||
// flags from the baseband core.
|
// flags from the baseband core.
|
||||||
if( thread ) {
|
if( thread ) {
|
||||||
chEvtSignalI(thread, EVT_FIFO_HIGHWATER);
|
chEvtSignalI(thread, EVT_MASK_CAPTURE_THREAD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr size_t write_size = 16384;
|
static constexpr size_t write_size = 16384;
|
||||||
static constexpr eventmask_t EVT_FIFO_HIGHWATER = 1;
|
|
||||||
|
|
||||||
const std::string file_path;
|
const std::string file_path;
|
||||||
std::unique_ptr<std::array<uint8_t, write_size>> write_buffer;
|
std::unique_ptr<std::array<uint8_t, write_size>> write_buffer;
|
||||||
@ -117,7 +116,7 @@ private:
|
|||||||
StreamOutput stream;
|
StreamOutput stream;
|
||||||
|
|
||||||
while( !chThdShouldTerminate() ) {
|
while( !chThdShouldTerminate() ) {
|
||||||
chEvtWaitAny(EVT_FIFO_HIGHWATER);
|
chEvtWaitAny(EVT_MASK_CAPTURE_THREAD);
|
||||||
|
|
||||||
while( stream.available() >= write_buffer->size() ) {
|
while( stream.available() >= write_buffer->size() ) {
|
||||||
if( !transfer(stream, write_buffer.get()) ) {
|
if( !transfer(stream, write_buffer.get()) ) {
|
||||||
|
@ -43,6 +43,7 @@ constexpr auto EVT_MASK_SWITCHES = EVENT_MASK(3);
|
|||||||
constexpr auto EVT_MASK_ENCODER = EVENT_MASK(4);
|
constexpr auto EVT_MASK_ENCODER = EVENT_MASK(4);
|
||||||
constexpr auto EVT_MASK_TOUCH = EVENT_MASK(5);
|
constexpr auto EVT_MASK_TOUCH = EVENT_MASK(5);
|
||||||
constexpr auto EVT_MASK_APPLICATION = EVENT_MASK(6);
|
constexpr auto EVT_MASK_APPLICATION = EVENT_MASK(6);
|
||||||
|
constexpr auto EVT_MASK_CAPTURE_THREAD = EVENT_MASK(7);
|
||||||
|
|
||||||
class EventDispatcher {
|
class EventDispatcher {
|
||||||
public:
|
public:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user