mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-29 04:09:58 -07:00
Formatting & New updated IR
This commit is contained in:
@@ -4,15 +4,16 @@
|
||||
/* Our circular buffer of raw samples, used in order to display
|
||||
* the signal. */
|
||||
|
||||
#define RAW_SAMPLES_NUM 2048 /* Use a power of two: we take the modulo
|
||||
#define RAW_SAMPLES_NUM \
|
||||
2048 /* Use a power of two: we take the modulo
|
||||
of the index quite often to normalize inside
|
||||
the range, and division is slow. */
|
||||
|
||||
typedef struct RawSamplesBuffer {
|
||||
FuriMutex *mutex;
|
||||
FuriMutex* mutex;
|
||||
uint8_t level[RAW_SAMPLES_NUM];
|
||||
uint32_t dur[RAW_SAMPLES_NUM];
|
||||
uint32_t idx; /* Current idx (next to write). */
|
||||
uint32_t idx; /* Current idx (next to write). */
|
||||
uint32_t total; /* Total samples: same as RAW_SAMPLES_NUM, we provide
|
||||
this field for a cleaner interface with the user, but
|
||||
we always use RAW_SAMPLES_NUM when taking the modulo so
|
||||
@@ -21,10 +22,10 @@ typedef struct RawSamplesBuffer {
|
||||
uint32_t short_pulse_dur; /* Duration of the shortest pulse. */
|
||||
} RawSamplesBuffer;
|
||||
|
||||
RawSamplesBuffer *raw_samples_alloc(void);
|
||||
void raw_samples_reset(RawSamplesBuffer *s);
|
||||
void raw_samples_center(RawSamplesBuffer *s, uint32_t offset);
|
||||
void raw_samples_add(RawSamplesBuffer *s, bool level, uint32_t dur);
|
||||
void raw_samples_get(RawSamplesBuffer *s, uint32_t idx, bool *level, uint32_t *dur);
|
||||
void raw_samples_copy(RawSamplesBuffer *dst, RawSamplesBuffer *src);
|
||||
void raw_samples_free(RawSamplesBuffer *s);
|
||||
RawSamplesBuffer* raw_samples_alloc(void);
|
||||
void raw_samples_reset(RawSamplesBuffer* s);
|
||||
void raw_samples_center(RawSamplesBuffer* s, uint32_t offset);
|
||||
void raw_samples_add(RawSamplesBuffer* s, bool level, uint32_t dur);
|
||||
void raw_samples_get(RawSamplesBuffer* s, uint32_t idx, bool* level, uint32_t* dur);
|
||||
void raw_samples_copy(RawSamplesBuffer* dst, RawSamplesBuffer* src);
|
||||
void raw_samples_free(RawSamplesBuffer* s);
|
||||
|
||||
Reference in New Issue
Block a user