mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2024-12-13 19:54:39 +00:00
Merge pull request #367 from teixeluis/hotfix-rx-hang-issue-365
Added fix in the scope of issue #365
This commit is contained in:
commit
95f72991c4
@ -111,14 +111,12 @@ void set_direction(const rf::Direction new_direction) {
|
|||||||
// Hack to fix the CPLD (clocking ?) bug: toggle CPLD SRAM overlay depending on new direction
|
// Hack to fix the CPLD (clocking ?) bug: toggle CPLD SRAM overlay depending on new direction
|
||||||
// Use CPLD's EEPROM config when transmitting
|
// Use CPLD's EEPROM config when transmitting
|
||||||
// Use the SRAM overlay when receiving
|
// Use the SRAM overlay when receiving
|
||||||
if (direction != new_direction) {
|
|
||||||
if (new_direction == rf::Direction::Transmit) {
|
// teixeluis: undone "Hack to fix the CPLD (clocking ?) bug".
|
||||||
hackrf::cpld::init_from_eeprom();
|
// Apparently with current CPLD code from the hackrf repo,
|
||||||
} else {
|
// toggling CPLD overlay should no longer be necessary:
|
||||||
if( !hackrf::cpld::load_sram() ) {
|
if (direction != new_direction && new_direction == rf::Direction::Transmit) {
|
||||||
chSysHalt();
|
hackrf::cpld::init_from_eeprom();
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
direction = new_direction;
|
direction = new_direction;
|
||||||
|
@ -171,7 +171,11 @@ void ReceiverModel::enable() {
|
|||||||
update_baseband_bandwidth();
|
update_baseband_bandwidth();
|
||||||
update_sampling_rate();
|
update_sampling_rate();
|
||||||
update_modulation();
|
update_modulation();
|
||||||
|
|
||||||
|
// TODO: would challenge if this should belong to the
|
||||||
|
// receiver_model namespace:
|
||||||
update_headphone_volume();
|
update_headphone_volume();
|
||||||
|
|
||||||
led_rx.on();
|
led_rx.on();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -182,6 +186,10 @@ void ReceiverModel::disable() {
|
|||||||
// TODO: Responsibility for enabling/disabling the radio is muddy.
|
// TODO: Responsibility for enabling/disabling the radio is muddy.
|
||||||
// Some happens in ReceiverModel, some inside radio namespace.
|
// Some happens in ReceiverModel, some inside radio namespace.
|
||||||
radio::disable();
|
radio::disable();
|
||||||
|
|
||||||
|
// TODO: we are doing this repeatedly in different levels of the
|
||||||
|
// call stack. Keeping it for now, but there seem to be too many
|
||||||
|
// redundant calls:
|
||||||
led_rx.off();
|
led_rx.off();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user