From 88d9220f561578ef80364aa9130eae3c792f9f7a Mon Sep 17 00:00:00 2001 From: Michael Colton Date: Wed, 11 May 2016 16:57:45 -0600 Subject: [PATCH] This fixes (I think) the ADC issue. Or rather, interprets the already correct values correctly. Anyway. I think we are good, though more testing would be nice. I compared the F4 display performance to the F7 to see if the flickering/shimmering effect was there. It was not..... because the display was scrolling so slowly by comparison! The F7 is so fast that it was sometimes calculating and drawing the waterfall twice! Should be better now, but I may want to slow it down further. Also some changes to the power up/clock settings functions. Turns out there were two, not sure which is better or more complete. They both work well enough for now. So with this, I think the F7 is now doing everything the F4 was doing, and can become the official chip of the next board revision. --- Hardware/PSDR.sch | Bin 525874 -> 521505 bytes Source/include/main.h | 4 +- Source/src/_initialize_hardware.c | 2 +- Source/src/adc.c | 24 ++++--- Source/src/main.c | 102 ++++++++++++++++++++---------- 5 files changed, 90 insertions(+), 42 deletions(-) diff --git a/Hardware/PSDR.sch b/Hardware/PSDR.sch index 7fb5bf80ff77385fd9a0a75dd19935b3b8c64e9a..8bdb7e10e0568583c2c777d6d663f0f960eb7168 100644 GIT binary patch delta 8474 zcmZu$4O~=J+CRh0FmoqOO3}f!^#*>RB2DB68p*{^Qk2QB#w-}*Lr8=Pv1QAZ(b}ZV zwK1&A`)(z*mF%zWC#CK1Ze{3FnIC+p85jv!o8*w9qOgMS{-1O2g%S52&YW}a|9_tI zoacGYx%V7C+Ah9zVYJ6Ky6m1dGgGfoR2mrbp`gsfww;L~hUkQA!p>}Kj6LcdfXZc~ z0u6r-VCbLCJUYhG)Y3Yo&AhYHYLFg>oJMPmv-X10CAeH*Ib-qQSGrJc zza~U4_8A%O9n^<~vH2(p(1-ooHlf(2vl`4}+RViXI%`a3;=5dc1O_Qz0&169x>hO} zZdpA2>|#uhqAd{GzVWW1xD=AC_rGT-{uGib(k^nHg23QrFi{ibaz60hExlAiH|?rj zebHPT6kyfY|Mg<=q<|1Z`1(uceenUELxu!78Aj2IYf0krdCQ8Qdgh*h*mcD@cSi<< zZz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