mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-12-06 03:52:12 +00:00
Recovered lost ctcss/roger beep/correct mic gain in mic app from 1.5.1 without ALC (Auto mic Limit Control-AK) (#633)
* Update spectrum_collector.cpp lower case correction * Update spectrum_collector.cpp Description changed , better explanation. * Revert "Update spectrum_collector.cpp" This reverts commit4a6fc35384. * Revert "Update spectrum_collector.cpp" This reverts commit35cece1cb0. * Revert "Solving Compile error on gcc10 . Keeping same safety protection about the size of the array ,but with slightly different sintax." This reverts commitf4db4e2b53. * Recovered CTCSS-Roger_beep-MIC-GAIN from 1.5.1 * Temporary removing ALC-( for AK4951 platorm)
This commit is contained in:
@@ -35,8 +35,10 @@ void MicTXProcessor::execute(const buffer_c8_t& buffer){
|
||||
if (!configured) return;
|
||||
|
||||
audio_input.read_audio_buffer(audio_buffer);
|
||||
modulator->execute(audio_buffer, buffer);
|
||||
|
||||
modulator->set_gain_vumeter_beep(audio_gain, play_beep ) ;
|
||||
modulator->execute(audio_buffer, buffer, configured, beep_index, beep_timer, txprogress_message, level_message, power_acc_count, divider ); // Now "Key Tones & CTCSS" baseband additon inside FM mod. dsp_modulate.cpp"
|
||||
|
||||
/* Original fw 1.3.1 good reference, beep and vu-meter
|
||||
for (size_t i = 0; i < buffer.count; i++) {
|
||||
|
||||
if (!play_beep) {
|
||||
@@ -67,13 +69,13 @@ void MicTXProcessor::execute(const buffer_c8_t& buffer){
|
||||
beep_index++;
|
||||
}
|
||||
}
|
||||
|
||||
sample = beep_gen.process(0);
|
||||
}
|
||||
|
||||
/*
|
||||
sample = beep_gen.process(0); // TODO : Pending how to move inside modulate.cpp
|
||||
}
|
||||
*/
|
||||
|
||||
/* Original fw 1.3.1 good reference FM moulation version, including "key tones CTCSS" fw 1.3.1
|
||||
sample = tone_gen.process(sample);
|
||||
|
||||
|
||||
// FM
|
||||
if (configured) {
|
||||
delta = sample * fm_delta;
|
||||
@@ -89,8 +91,8 @@ void MicTXProcessor::execute(const buffer_c8_t& buffer){
|
||||
}
|
||||
|
||||
buffer.p[i] = { re, im };
|
||||
*/
|
||||
}
|
||||
|
||||
} */
|
||||
}
|
||||
|
||||
void MicTXProcessor::on_message(const Message* const msg) {
|
||||
@@ -100,12 +102,16 @@ void MicTXProcessor::on_message(const Message* const msg) {
|
||||
switch(msg->id) {
|
||||
case Message::ID::AudioTXConfig:
|
||||
if (fm_enabled) {
|
||||
dsp::modulate::FM *fm = new dsp::modulate::FM();
|
||||
|
||||
fm->set_fm_delta(config_message.deviation_hz * (0xFFFFFFUL / baseband_fs));
|
||||
dsp::modulate::FM *fm = new dsp::modulate::FM();
|
||||
|
||||
// Config fm_delta private var inside DSP modulate.cpp
|
||||
fm->set_fm_delta(config_message.deviation_hz * (0xFFFFFFUL / baseband_fs));
|
||||
|
||||
// Config properly the private tone_gen function parameters inside DSP modulate.cpp
|
||||
fm->set_tone_gen_configure(config_message.tone_key_delta, config_message.tone_key_mix_weight);
|
||||
modulator = fm;
|
||||
}
|
||||
|
||||
|
||||
if (usb_enabled) {
|
||||
modulator = new dsp::modulate::SSB();
|
||||
modulator->set_mode(dsp::modulate::Mode::USB);
|
||||
@@ -124,7 +130,7 @@ void MicTXProcessor::on_message(const Message* const msg) {
|
||||
modulator->set_mode(dsp::modulate::Mode::DSB);
|
||||
}
|
||||
|
||||
modulator->set_over(baseband_fs / 24000);
|
||||
modulator->set_over(baseband_fs / 24000); // Keep no change.
|
||||
|
||||
am_enabled = config_message.am_enabled;
|
||||
usb_enabled = config_message.usb_enabled;
|
||||
@@ -137,8 +143,9 @@ void MicTXProcessor::on_message(const Message* const msg) {
|
||||
audio_gain = config_message.audio_gain;
|
||||
divider = config_message.divider;
|
||||
power_acc_count = 0;
|
||||
|
||||
tone_gen.configure(config_message.tone_key_delta, config_message.tone_key_mix_weight);
|
||||
|
||||
// now this config moved, in the case Message::ID::AudioTXConfig , only FM case.
|
||||
// tone_gen.configure(config_message.tone_key_delta, config_message.tone_key_mix_weight);
|
||||
|
||||
txprogress_message.done = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user