mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-10-01 01:26:06 -04:00
Rename TPMS clock recovery, packet builders for accuracy.
This commit is contained in:
parent
65d2f263f2
commit
ad554b28b5
@ -48,10 +48,10 @@ void TPMSProcessor::execute(const buffer_c8_t& buffer) {
|
|||||||
const auto sliced = ook_slicer_5sps(decim_1_out.p[i]);
|
const auto sliced = ook_slicer_5sps(decim_1_out.p[i]);
|
||||||
slicer_history = (slicer_history << 1) | sliced;
|
slicer_history = (slicer_history << 1) | sliced;
|
||||||
|
|
||||||
ook_clock_recovery_subaru(slicer_history, [this](const bool symbol) {
|
clock_recovery_ook_8k192(slicer_history, [this](const bool symbol) {
|
||||||
this->packet_builder_ook_subaru.execute(symbol);
|
this->packet_builder_schrader.execute(symbol);
|
||||||
});
|
});
|
||||||
ook_clock_recovery_gmc(slicer_history, [this](const bool symbol) {
|
clock_recovery_ook_8k4(slicer_history, [this](const bool symbol) {
|
||||||
this->packet_builder_ook_gmc.execute(symbol);
|
this->packet_builder_ook_gmc.execute(symbol);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -92,20 +92,21 @@ private:
|
|||||||
OOKSlicerMagSquaredInt ook_slicer_5sps { 5 };
|
OOKSlicerMagSquaredInt ook_slicer_5sps { 5 };
|
||||||
uint32_t slicer_history { 0 };
|
uint32_t slicer_history { 0 };
|
||||||
|
|
||||||
OOKClockRecovery ook_clock_recovery_subaru {
|
OOKClockRecovery clock_recovery_ook_8k192 {
|
||||||
channel_sample_rate / 8192.0f
|
channel_sample_rate / 8192.0f
|
||||||
};
|
};
|
||||||
|
|
||||||
PacketBuilder<BitPattern, NeverMatch, FixedLength> packet_builder_ook_subaru {
|
PacketBuilder<BitPattern, NeverMatch, FixedLength> packet_builder_schrader {
|
||||||
{ 0b010101010101010101011110, 24, 0 },
|
{ 0b010101010101010101011110, 24, 0 },
|
||||||
{ },
|
{ },
|
||||||
{ 80 },
|
{ 80 },
|
||||||
[](const baseband::Packet& packet) {
|
[](const baseband::Packet& packet) {
|
||||||
const TPMSPacketMessage message { tpms::SignalType::Subaru, packet };
|
const TPMSPacketMessage message { tpms::SignalType::Schrader, packet };
|
||||||
shared_memory.application_queue.push(message);
|
shared_memory.application_queue.push(message);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
OOKClockRecovery ook_clock_recovery_gmc {
|
|
||||||
|
OOKClockRecovery clock_recovery_ook_8k4 {
|
||||||
channel_sample_rate / 8400.0f
|
channel_sample_rate / 8400.0f
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -67,9 +67,9 @@ Optional<Reading> Packet::reading(const SignalType signal_type) const {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( signal_type == SignalType::Subaru ) {
|
if( signal_type == SignalType::Schrader ) {
|
||||||
return Reading {
|
return Reading {
|
||||||
Reading::Type::SUB_35,
|
Reading::Type::Schrader,
|
||||||
reader_.read(3, 25),
|
reader_.read(3, 25),
|
||||||
Pressure { static_cast<int>(reader_.read(28, 8)) }
|
Pressure { static_cast<int>(reader_.read(28, 8)) }
|
||||||
};
|
};
|
||||||
|
@ -39,7 +39,7 @@ namespace tpms {
|
|||||||
|
|
||||||
enum SignalType : uint32_t {
|
enum SignalType : uint32_t {
|
||||||
FLM = 1,
|
FLM = 1,
|
||||||
Subaru = 2,
|
Schrader = 2,
|
||||||
GMC = 3,
|
GMC = 3,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ public:
|
|||||||
FLM_64 = 1,
|
FLM_64 = 1,
|
||||||
FLM_72 = 2,
|
FLM_72 = 2,
|
||||||
FLM_80 = 3,
|
FLM_80 = 3,
|
||||||
SUB_35 = 4,
|
Schrader = 4,
|
||||||
GMC_96 = 5,
|
GMC_96 = 5,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user