Cleanup of not needed code

This commit is contained in:
Jan Käberich 2020-11-24 18:06:57 +01:00
parent 3c2ff5e8c7
commit d63640d437
5 changed files with 862 additions and 469 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,25 +1,48 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project> <project>
<configuration id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.1502405410" name="Debug">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider"> <configuration id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.1502405410" name="Debug">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/> <extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="-516381900687258877" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true"> <provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/> <provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
</provider>
</extension> <provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
</configuration>
<configuration id="fr.ac6.managedbuild.config.gnu.cross.exe.release.1788779437" name="Release"> <provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="-1870342659776466326" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/> <language-scope id="org.eclipse.cdt.core.gcc"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/> <language-scope id="org.eclipse.cdt.core.g++"/>
<provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="-516381900687258877" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/> </provider>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider> </extension>
</extension>
</configuration> </configuration>
<configuration id="fr.ac6.managedbuild.config.gnu.cross.exe.release.1788779437" name="Release">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="1307432939745961523" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
</extension>
</configuration>
</project> </project>

View File

@ -24,10 +24,7 @@
#define LOG_MODULE "App" #define LOG_MODULE "App"
#include "Log.h" #include "Log.h"
static Protocol::SweepSettings settings; static Protocol::PacketInfo recv_packet;
static uint16_t lastPoint;
static Protocol::PacketInfo recv_packet, transmit_packet;
static TaskHandle_t handle; static TaskHandle_t handle;
#if HW_REVISION >= 'B' #if HW_REVISION >= 'B'
@ -39,18 +36,7 @@ static TaskHandle_t handle;
extern ADC_HandleTypeDef hadc1; extern ADC_HandleTypeDef hadc1;
#define FLAG_USB_PACKET 0x01 #define FLAG_USB_PACKET 0x01
#define FLAG_DATAPOINT 0x02
static void VNACallback(const Protocol::Datapoint &res) {
DEBUG2_HIGH();
transmit_packet.type = Protocol::PacketType::Datapoint;
transmit_packet.datapoint = res;
lastPoint = res.pointNum;
BaseType_t woken = false;
xTaskNotifyFromISR(handle, FLAG_DATAPOINT, eSetBits, &woken);
portYIELD_FROM_ISR(woken);
DEBUG2_LOW();
}
static void USBPacketReceived(const Protocol::PacketInfo &p) { static void USBPacketReceived(const Protocol::PacketInfo &p) {
recv_packet = p; recv_packet = p;
BaseType_t woken = false; BaseType_t woken = false;
@ -119,16 +105,11 @@ void App_Start() {
uint32_t notification; uint32_t notification;
if(xTaskNotifyWait(0x00, UINT32_MAX, &notification, 100) == pdPASS) { if(xTaskNotifyWait(0x00, UINT32_MAX, &notification, 100) == pdPASS) {
// something happened // something happened
if(notification & FLAG_DATAPOINT) {
Communication::Send(transmit_packet);
lastNewPoint = HAL_GetTick();
}
if(notification & FLAG_USB_PACKET) { if(notification & FLAG_USB_PACKET) {
switch(recv_packet.type) { switch(recv_packet.type) {
case Protocol::PacketType::SweepSettings: case Protocol::PacketType::SweepSettings:
LOG_INFO("New settings received"); LOG_INFO("New settings received");
settings = recv_packet.settings; sweepActive = VNA::Setup(recv_packet.settings);
sweepActive = VNA::Setup(settings, VNACallback);
lastNewPoint = HAL_GetTick(); lastNewPoint = HAL_GetTick();
Communication::SendWithoutPayload(Protocol::PacketType::Ack); Communication::SendWithoutPayload(Protocol::PacketType::Ack);
break; break;
@ -218,16 +199,5 @@ void App_Start() {
} }
} }
} }
// if(sweepActive && HAL_GetTick() - lastNewPoint > 1000) {
// LOG_WARN("Timed out waiting for point, last received point was %d (Status 0x%04x)", lastPoint, FPGA::GetStatus());
// FPGA::AbortSweep();
// // restart the current sweep
// HW::Init();
// HW::Ref::update();
// VNA::Setup(settings, VNACallback);
// sweepActive = true;
// lastNewPoint = HAL_GetTick();
// }
} }
} }

View File

@ -17,7 +17,6 @@
#define LOG_MODULE "VNA" #define LOG_MODULE "VNA"
#include "Log.h" #include "Log.h"
static VNA::SweepCallback sweepCallback;
static Protocol::SweepSettings settings; static Protocol::SweepSettings settings;
static uint16_t pointCnt; static uint16_t pointCnt;
static bool excitingPort1; static bool excitingPort1;
@ -44,7 +43,7 @@ static_assert(alternativePhaseInc * alternativeSamplerate == 4096 * HW::IF2, "DF
using namespace HWHAL; using namespace HWHAL;
bool VNA::Setup(Protocol::SweepSettings s, SweepCallback cb) { bool VNA::Setup(Protocol::SweepSettings s) {
VNA::Stop(); VNA::Stop();
vTaskDelay(5); vTaskDelay(5);
HW::SetMode(HW::Mode::VNA); HW::SetMode(HW::Mode::VNA);
@ -54,7 +53,6 @@ bool VNA::Setup(Protocol::SweepSettings s, SweepCallback cb) {
active = false; active = false;
return false; return false;
} }
sweepCallback = cb;
settings = s; settings = s;
// Abort possible active sweep first // Abort possible active sweep first
FPGA::SetMode(FPGA::Mode::FPGA); FPGA::SetMode(FPGA::Mode::FPGA);
@ -200,9 +198,6 @@ static void PassOnData() {
info.type = Protocol::PacketType::Datapoint; info.type = Protocol::PacketType::Datapoint;
info.datapoint = data; info.datapoint = data;
Communication::Send(info); Communication::Send(info);
// if (sweepCallback) {
// sweepCallback(data);
// }
} }
bool VNA::MeasurementDone(const FPGA::SamplingResult &result) { bool VNA::MeasurementDone(const FPGA::SamplingResult &result) {

View File

@ -6,9 +6,7 @@
namespace VNA { namespace VNA {
using SweepCallback = void(*)(const Protocol::Datapoint&); bool Setup(Protocol::SweepSettings s);
bool Setup(Protocol::SweepSettings s, SweepCallback cb);
bool MeasurementDone(const FPGA::SamplingResult &result); bool MeasurementDone(const FPGA::SamplingResult &result);
void Work(); void Work();
void SweepHalted(); void SweepHalted();