mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-09-10 08:39:29 +00:00
Rebased code from new eried repo commits. Changed to to reflect strijar implementation. Fixed previous issue with old ssb-am-tx ui_mictx code.
This commit is contained in:
@@ -35,6 +35,7 @@ void MicTXProcessor::execute(const buffer_c8_t& buffer){
|
||||
if (!configured) return;
|
||||
|
||||
audio_input.read_audio_buffer(audio_buffer);
|
||||
modulator->execute(audio_buffer, buffer);
|
||||
|
||||
for (size_t i = 0; i < buffer.count; i++) {
|
||||
|
||||
@@ -70,6 +71,7 @@ void MicTXProcessor::execute(const buffer_c8_t& buffer){
|
||||
sample = beep_gen.process(0);
|
||||
}
|
||||
|
||||
/*
|
||||
sample = tone_gen.process(sample);
|
||||
|
||||
// FM
|
||||
@@ -87,6 +89,7 @@ void MicTXProcessor::execute(const buffer_c8_t& buffer){
|
||||
}
|
||||
|
||||
buffer.p[i] = { re, im };
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +99,40 @@ void MicTXProcessor::on_message(const Message* const msg) {
|
||||
|
||||
switch(msg->id) {
|
||||
case Message::ID::AudioTXConfig:
|
||||
fm_delta = config_message.deviation_hz * (0xFFFFFFUL / baseband_fs);
|
||||
if (fm_enabled) {
|
||||
dsp::modulate::FM *fm = new dsp::modulate::FM();
|
||||
|
||||
fm->set_fm_delta(config_message.deviation_hz * (0xFFFFFFUL / baseband_fs));
|
||||
modulator = fm;
|
||||
}
|
||||
|
||||
if (usb_enabled) {
|
||||
modulator = new dsp::modulate::SSB();
|
||||
modulator->set_mode(dsp::modulate::Mode::USB);
|
||||
}
|
||||
|
||||
if (lsb_enabled) {
|
||||
modulator = new dsp::modulate::SSB();
|
||||
modulator->set_mode(dsp::modulate::Mode::LSB);
|
||||
}
|
||||
if (am_enabled) {
|
||||
modulator = new dsp::modulate::AM();
|
||||
modulator->set_mode(dsp::modulate::Mode::AM);
|
||||
}
|
||||
if (dsb_enabled) {
|
||||
modulator = new dsp::modulate::AM();
|
||||
modulator->set_mode(dsp::modulate::Mode::DSB);
|
||||
}
|
||||
|
||||
modulator->set_over(baseband_fs / 24000);
|
||||
|
||||
am_enabled = config_message.am_enabled;
|
||||
usb_enabled = config_message.usb_enabled;
|
||||
lsb_enabled = config_message.lsb_enabled;
|
||||
dsb_enabled = config_message.dsb_enabled;
|
||||
if (!am_enabled || !usb_enabled || !lsb_enabled || !dsb_enabled) {
|
||||
fm_enabled = true;
|
||||
}
|
||||
|
||||
audio_gain = config_message.audio_gain;
|
||||
divider = config_message.divider;
|
||||
|
||||
Reference in New Issue
Block a user