mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-09-11 00:59:28 +00:00
More SGD
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#ifndef __FPROTO_GENERAL_H__
|
||||
#define __FPROTO_GENERAL_H__
|
||||
|
||||
// useful methods for both weather and subghzd
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
@@ -7,6 +7,10 @@ class FProtoListGeneral {
|
||||
FProtoListGeneral() {}
|
||||
virtual ~FProtoListGeneral() {}
|
||||
virtual void feed(bool level, uint32_t duration) = 0;
|
||||
void setModulation(uint8_t modulation) { modulation_ = modulation; }
|
||||
|
||||
protected:
|
||||
uint8_t modulation_ = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -26,7 +26,7 @@ class FProtoSubGhzDBase {
|
||||
|
||||
uint8_t getSensorType() { return sensorType; }
|
||||
uint32_t getSensorId() { return id; }
|
||||
|
||||
FPROTO_SUBGHZD_MODULATION modulation = FPM_AM; // override this, if FM
|
||||
protected:
|
||||
// Helper functions to keep it as compatible with flipper as we can, so adding new protos will be easy.
|
||||
void subghz_protocol_blocks_add_bit(uint8_t bit) {
|
||||
@@ -37,7 +37,6 @@ class FProtoSubGhzDBase {
|
||||
// General weather data holder
|
||||
uint8_t sensorType = FPS_Invalid;
|
||||
uint32_t id = SD_NO_ID;
|
||||
FPROTO_SUBGHZD_MODULATION modulation = FPM_AM; // override this, if FM
|
||||
|
||||
// inner logic stuff, also for flipper compatibility.
|
||||
SubGhzDProtocolDecoderBaseRxCallback callback = NULL;
|
||||
|
||||
@@ -34,7 +34,7 @@ class SubGhzDProtos : public FProtoListGeneral {
|
||||
|
||||
void feed(bool level, uint32_t duration) {
|
||||
for (const auto& obj : protos) {
|
||||
obj->feed(level, duration);
|
||||
if (obj->modulation == modulation_) obj->feed(level, duration);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user