From ffd204d081c3220bd8f23d0b45b18edcca950433 Mon Sep 17 00:00:00 2001 From: erikkaashoek Date: Mon, 15 Jun 2020 16:09:11 +0200 Subject: [PATCH] Github name change --- .cproject | 47 ++++++++++++++++++++++------------------------- .project | 1 + sa_core.c | 18 ++++++++++++++++++ 3 files changed, 41 insertions(+), 25 deletions(-) diff --git a/.cproject b/.cproject index 4714753..1e880c3 100644 --- a/.cproject +++ b/.cproject @@ -1,40 +1,33 @@ - - + + - + - - - - - + + + + + + + - - diff --git a/.project b/.project index 7f853bc..f5b7df6 100644 --- a/.project +++ b/.project @@ -22,5 +22,6 @@ org.eclipse.cdt.core.cnature org.eclipse.cdt.managedbuilder.core.managedBuildNature org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + org.eclipse.cdt.core.ccnature diff --git a/sa_core.c b/sa_core.c index da18012..2fb7e88 100644 --- a/sa_core.c +++ b/sa_core.c @@ -1144,6 +1144,10 @@ float perform(bool break_on_operation, int i, uint32_t f, int tracking) } if (MODE_OUTPUT(setting.mode) && (setting.modulation == MO_AM_1kHz||setting.modulation == MO_AM_10Hz)) { // AM modulation int p = setting.attenuate * 2 + am_modulation[modulation_counter]; + if (p>63) + p = 63; + if (p<0) + p = 0; PE4302_Write_Byte(p); if (modulation_counter == 4) { // 3dB modulation depth modulation_counter = 0; @@ -1539,6 +1543,20 @@ again: // dirty = true; // Must be above if(scandirty!!!!!) } } + if (!in_selftest && MODE_INPUT(setting.mode) && S_IS_AUTO(setting.agc) && UNIT_IS_LINEAR(setting.unit)) { // Auto AGC in linear mode + unsigned char v; + static unsigned char old_v; + float actual_max_level = actual_t[max_index[0]] - setting.attenuate; + if (actual_max_level > - 45) + v = 0x50; // Disable AGC and enable LNA + else + v = 0x60; // Enable AGC and disable LNA + if (old_v != v) { + SI4432_Write_Byte(0x69, v); + old_v = v; + } + + } if (max_index[0] > 0) temppeakLevel = actual_t[max_index[0]];