mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-05-16 13:42:16 -04:00
Use correct memory region for persistent storage.
Turns out 0x10088000 - 0x10089fff is not the right place. It's 0x40041000, and is only 256 bytes! Move PPM to correct place, change representation to PPB for finer control. Reset PPB value to initial value if read value out of bounds. Clip PPB value on write to permitted bounds. Contributes to resolution of issue #11.
This commit is contained in:
parent
255de16d3e
commit
45d26abf10
8 changed files with 120 additions and 8 deletions
|
@ -37,6 +37,7 @@
|
|||
using namespace hackrf::one;
|
||||
|
||||
#include "portapack.hpp"
|
||||
#include "portapack_persistent_memory.hpp"
|
||||
|
||||
namespace radio {
|
||||
|
||||
|
@ -117,7 +118,8 @@ void set_direction(const rf::Direction new_direction) {
|
|||
}
|
||||
|
||||
bool set_tuning_frequency(const rf::Frequency frequency) {
|
||||
rf::Frequency corrected_frequency = frequency * (1000000 + shared_memory.correction_ppm) / 1000000;
|
||||
const int32_t frequency_correction = frequency * portapack::persistent_memory::correction_ppb() / 1000000000;
|
||||
rf::Frequency corrected_frequency = frequency + frequency_correction;
|
||||
const auto tuning_config = tuning::config::create(corrected_frequency);
|
||||
if( tuning_config.is_valid() ) {
|
||||
first_if.disable();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue