mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-01 19:16:29 -04: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:
parent
4465cfb905
commit
32ae059c44
5 changed files with 19 additions and 5 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue