kopia lustrzana https://github.com/mobilinkd/tnc3-firmware
Fix battery level values when 9600 baud is selected.
rodzic
5503b329e8
commit
240f7b0413
|
@ -198,9 +198,9 @@ uint32_t Afsk1200Demodulator::readBatteryLevel()
|
||||||
|
|
||||||
// Order of operations is important to avoid underflow.
|
// Order of operations is important to avoid underflow.
|
||||||
vbat *= 6600;
|
vbat *= 6600;
|
||||||
vbat /= (vrefint + 1);
|
vbat /= (VREF + 1);
|
||||||
|
|
||||||
uint32_t vref = (vrefint * 3300) + (VREF / 2) / VREF;
|
uint32_t vref = ((vrefint * 3300) + (VREF / 2)) / VREF;
|
||||||
|
|
||||||
INFO("Vref = %lumV", vref)
|
INFO("Vref = %lumV", vref)
|
||||||
INFO("Vbat = %lumV", vbat);
|
INFO("Vbat = %lumV", vbat);
|
||||||
|
|
|
@ -158,9 +158,9 @@ uint32_t Fsk9600Demodulator::readBatteryLevel()
|
||||||
|
|
||||||
// Order of operations is important to avoid underflow.
|
// Order of operations is important to avoid underflow.
|
||||||
vbat *= 6600;
|
vbat *= 6600;
|
||||||
vbat /= (vrefint + 1);
|
vbat /= (VREF + 1);
|
||||||
|
|
||||||
uint32_t vref = (vrefint * 3300) + (VREF / 2) / VREF;
|
uint32_t vref = ((vrefint * 3300) + (VREF / 2)) / VREF;
|
||||||
|
|
||||||
INFO("Vref = %lumV", vref)
|
INFO("Vref = %lumV", vref)
|
||||||
INFO("Vbat = %lumV", vbat);
|
INFO("Vbat = %lumV", vbat);
|
||||||
|
|
|
@ -32,7 +32,7 @@ struct Fsk9600Demodulator : IDemodulator
|
||||||
static_assert(audio::ADC_BUFFER_SIZE >= ADC_BLOCK_SIZE);
|
static_assert(audio::ADC_BUFFER_SIZE >= ADC_BLOCK_SIZE);
|
||||||
|
|
||||||
static constexpr uint32_t SAMPLE_RATE = 192000;
|
static constexpr uint32_t SAMPLE_RATE = 192000;
|
||||||
static constexpr uint16_t VREF = 16383;
|
static constexpr uint16_t VREF = 4095;
|
||||||
|
|
||||||
using bpf_coeffs_type = std::array<int16_t, FILTER_TAP_NUM>;
|
using bpf_coeffs_type = std::array<int16_t, FILTER_TAP_NUM>;
|
||||||
using bpf_bank_type = std::array<bpf_coeffs_type, 13>;
|
using bpf_bank_type = std::array<bpf_coeffs_type, 13>;
|
||||||
|
|
Ładowanie…
Reference in New Issue