mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-12-18 04:04:33 -05:00
Store PPM in shared memory for now.
This commit is contained in:
parent
9dd41ed48d
commit
3874c82d57
@ -618,6 +618,7 @@ int main(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
init_message_queues();
|
init_message_queues();
|
||||||
|
shared_memory.correction_ppm = 0;
|
||||||
|
|
||||||
portapack::io.init();
|
portapack::io.init();
|
||||||
ui::Context context;
|
ui::Context context;
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include "max5864.hpp"
|
#include "max5864.hpp"
|
||||||
#include "baseband_cpld.hpp"
|
#include "baseband_cpld.hpp"
|
||||||
#include "baseband_sgpio.hpp"
|
#include "baseband_sgpio.hpp"
|
||||||
|
#include "portapack_shared_memory.hpp"
|
||||||
|
|
||||||
#include "tuning.hpp"
|
#include "tuning.hpp"
|
||||||
|
|
||||||
@ -117,7 +118,7 @@ void set_direction(const rf::Direction new_direction) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool set_tuning_frequency(const rf::Frequency frequency) {
|
bool set_tuning_frequency(const rf::Frequency frequency) {
|
||||||
rf::Frequency corrected_frequency = frequency * (1000000 - 10) / 1000000;
|
rf::Frequency corrected_frequency = frequency * (1000000 + shared_memory.correction_ppm) / 1000000;
|
||||||
const auto tuning_config = tuning::config::create(corrected_frequency);
|
const auto tuning_config = tuning::config::create(corrected_frequency);
|
||||||
if( tuning_config.is_valid() ) {
|
if( tuning_config.is_valid() ) {
|
||||||
first_if.disable();
|
first_if.disable();
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
#include "ui_setup.hpp"
|
#include "ui_setup.hpp"
|
||||||
|
|
||||||
|
#include "portapack_shared_memory.hpp"
|
||||||
#include "lpc43xx_cpp.hpp"
|
#include "lpc43xx_cpp.hpp"
|
||||||
using namespace lpc43xx;
|
using namespace lpc43xx;
|
||||||
|
|
||||||
@ -103,6 +104,7 @@ SetFrequencyCorrectionView::SetFrequencyCorrectionView(
|
|||||||
) {
|
) {
|
||||||
button_ok.on_select = [&nav, this](Button&){
|
button_ok.on_select = [&nav, this](Button&){
|
||||||
const auto model = this->form_collect();
|
const auto model = this->form_collect();
|
||||||
|
shared_memory.correction_ppm = model.ppm;
|
||||||
nav.pop();
|
nav.pop();
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -119,7 +121,7 @@ SetFrequencyCorrectionView::SetFrequencyCorrectionView(
|
|||||||
} });
|
} });
|
||||||
|
|
||||||
SetFrequencyCorrectionModel model {
|
SetFrequencyCorrectionModel model {
|
||||||
0
|
shared_memory.correction_ppm
|
||||||
};
|
};
|
||||||
|
|
||||||
form_init(model);
|
form_init(model);
|
||||||
|
@ -38,6 +38,7 @@ struct SharedMemory {
|
|||||||
// TODO: M0 should directly configure and control DMA channel that is
|
// TODO: M0 should directly configure and control DMA channel that is
|
||||||
// acquiring ADC samples.
|
// acquiring ADC samples.
|
||||||
TouchADCFrame touch_adc_frame;
|
TouchADCFrame touch_adc_frame;
|
||||||
|
int8_t correction_ppm;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern SharedMemory& shared_memory;
|
extern SharedMemory& shared_memory;
|
||||||
|
Loading…
Reference in New Issue
Block a user