0
1
mirror of https://github.com/radio95-rnt/fm95.git synced 2026-02-26 19:23:51 +01:00

change bs412 logic

This commit is contained in:
2025-04-29 20:21:11 +02:00
parent c4d5c39ed5
commit 92a358bfdb

View File

@@ -9,7 +9,7 @@ float deviation_to_dbr(float deviation) {
}
void init_modulation_power_measure(MPXPowerMeasurement* mpx, int sample_rate) {
mpx->i = 1;
mpx->i = 0;
mpx->sample = 0;
mpx->sample_rate = sample_rate;
}
@@ -22,8 +22,8 @@ float measure_mpx(MPXPowerMeasurement* mpx, float deviation) {
float modulation_power = deviation_to_dbr(avg_deviation);
if (mpx->i >= mpx->sample_rate * 60) {
mpx->sample = 0;
mpx->i = 0;
mpx->sample = avg_deviation * avg_deviation;
mpx->i = 1;
}
return modulation_power;