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:
furrtek 2017-11-09 22:25:37 +00:00
parent 4465cfb905
commit 32ae059c44
5 changed files with 19 additions and 5 deletions

View file

@ -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);