mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-30 01:27:24 -04:00
Merge remote-tracking branch 'upstream/master'
# Conflicts: # firmware/application/bitmap.hpp # firmware/application/receiver_model.cpp # firmware/application/receiver_model.hpp # firmware/application/touch.hpp # firmware/application/ui_setup.cpp # firmware/baseband/proc_ais.hpp # firmware/baseband/proc_ert.hpp # firmware/bootstrap/CMakeLists.txt # firmware/common/portapack_persistent_memory.cpp # firmware/common/portapack_persistent_memory.hpp
This commit is contained in:
commit
45a754645e
43 changed files with 1089 additions and 543 deletions
|
@ -36,7 +36,7 @@ using portapack::memory::map::backup_ram;
|
|||
namespace portapack {
|
||||
namespace persistent_memory {
|
||||
|
||||
constexpr rf::Frequency tuned_frequency_reset_value { 88000000 };
|
||||
constexpr rf::Frequency tuned_frequency_reset_value { 100000000 };
|
||||
|
||||
using ppb_range_t = range_t<ppb_t>;
|
||||
constexpr ppb_range_t ppb_range { -99000, 99000 };
|
||||
|
@ -57,9 +57,11 @@ constexpr int32_t afsk_bw_reset_value { 15 };
|
|||
|
||||
/* struct must pack the same way on M4 and M0 cores. */
|
||||
struct data_t {
|
||||
// General config
|
||||
int64_t tuned_frequency;
|
||||
int32_t correction_ppb;
|
||||
uint32_t touch_calibration_magic;
|
||||
touch::Calibration touch_calibration;
|
||||
|
||||
|
||||
// AFSK modem
|
||||
int32_t afsk_mark_freq;
|
||||
|
@ -99,6 +101,20 @@ void set_correction_ppb(const ppb_t new_value) {
|
|||
portapack::clock_manager.set_reference_ppb(clipped_value);
|
||||
}
|
||||
|
||||
static constexpr uint32_t touch_calibration_magic = 0x074af82f;
|
||||
|
||||
void set_touch_calibration(const touch::Calibration& new_value) {
|
||||
data->touch_calibration = new_value;
|
||||
data->touch_calibration_magic = touch_calibration_magic;
|
||||
}
|
||||
|
||||
const touch::Calibration& touch_calibration() {
|
||||
if( data->touch_calibration_magic != touch_calibration_magic ) {
|
||||
set_touch_calibration(touch::default_calibration());
|
||||
}
|
||||
return data->touch_calibration;
|
||||
}
|
||||
|
||||
int32_t afsk_mark_freq() {
|
||||
afsk_freq_range.reset_if_outside(data->afsk_mark_freq, afsk_mark_reset_value);
|
||||
return data->afsk_mark_freq;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue