mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-10-19 07:32:42 +00:00
Added workaround for the CPLD overlay issue in tx mode
Set back mic samplerate to 24kHz because 48kHz was poop :(
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
//BUG: SCANNER Lock on frequency, if frequency jump, still locked on first one
|
||||
//BUG: SCANNER Multiple slices
|
||||
|
||||
//TODO: Make tone generator class for baseband (with freq, samplerate and mixing ratio parameters)
|
||||
//TODO: Cap Wav viewer position
|
||||
//TODO: Adapt wav viewer position step
|
||||
//TODO: Use unit_auto_scale
|
||||
|
@@ -36,6 +36,8 @@
|
||||
#include "hackrf_gpio.hpp"
|
||||
using namespace hackrf::one;
|
||||
|
||||
#include "cpld_update.hpp"
|
||||
|
||||
#include "portapack.hpp"
|
||||
|
||||
namespace radio {
|
||||
@@ -105,6 +107,17 @@ void init() {
|
||||
void set_direction(const rf::Direction new_direction) {
|
||||
/* TODO: Refactor all the various "Direction" enumerations into one. */
|
||||
/* TODO: Only make changes if direction changes, but beware of clock enabling. */
|
||||
|
||||
if (direction != new_direction) {
|
||||
if (new_direction == rf::Direction::Transmit) {
|
||||
hackrf::cpld::init_from_eeprom();
|
||||
} else {
|
||||
if( !hackrf::cpld::load_sram() ) {
|
||||
chSysHalt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
direction = new_direction;
|
||||
|
||||
second_if.set_mode((direction == rf::Direction::Transmit) ? max2837::Mode::Transmit : max2837::Mode::Receive);
|
||||
|
@@ -129,9 +129,9 @@ MicTXView::MicTXView(
|
||||
)
|
||||
{
|
||||
pins[P6_2].mode(3); // Set P6_2 pin function to I2S0_RX_SDA
|
||||
|
||||
baseband::run_image(portapack::spi_flash::image_tag_mic_tx);
|
||||
|
||||
baseband::run_image(portapack::spi_flash::image_tag_mic_tx);
|
||||
|
||||
add_children({
|
||||
&labels,
|
||||
&vumeter,
|
||||
@@ -220,7 +220,7 @@ MicTXView::MicTXView(
|
||||
|
||||
set_tx(false);
|
||||
|
||||
audio::set_rate(audio::Rate::Hz_48000);
|
||||
audio::set_rate(audio::Rate::Hz_24000);
|
||||
audio::input::start();
|
||||
}
|
||||
|
||||
|
@@ -74,7 +74,7 @@ private:
|
||||
bool rogerbeep_enabled { };
|
||||
uint32_t tone_key_index { };
|
||||
bool tone_key_enabled { };
|
||||
uint32_t mic_gain_x10 { };
|
||||
uint32_t mic_gain_x10 { 10 };
|
||||
uint32_t audio_level { 0 };
|
||||
uint32_t va_level { };
|
||||
uint32_t attack_ms { };
|
||||
|
Reference in New Issue
Block a user