Bugfix: race condition removed when changing settings on fast sweep
This commit is contained in:
parent
967d72c11e
commit
eb64e042f4
BIN
Software/PC_Application/Application
Executable file
BIN
Software/PC_Application/Application
Executable file
Binary file not shown.
@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||||
|
|
||||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
||||||
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||||
|
|
||||||
<configuration artifactExtension="elf" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.1502405410" name="Debug" optionalBuildProperties="org.eclipse.cdt.docker.launcher.containerbuild.property.selectedvolumes=,org.eclipse.cdt.docker.launcher.containerbuild.property.volumes=" parent="fr.ac6.managedbuild.config.gnu.cross.exe.debug" postannouncebuildStep="Generating hex and Printing size information:" postbuildStep="arm-none-eabi-objcopy -O ihex "${BuildArtifactFileBaseName}.elf" "${BuildArtifactFileBaseName}.hex" && arm-none-eabi-size "${BuildArtifactFileName}"">
|
<configuration artifactExtension="elf" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.1502405410" name="Debug" optionalBuildProperties="org.eclipse.cdt.docker.launcher.containerbuild.property.selectedvolumes=,org.eclipse.cdt.docker.launcher.containerbuild.property.volumes=" parent="fr.ac6.managedbuild.config.gnu.cross.exe.debug" postannouncebuildStep="Generating hex and Printing size information:" postbuildStep="arm-none-eabi-objcopy -O binary "${BuildArtifactFileBaseName}.elf" "${BuildArtifactFileBaseName}.bin" && arm-none-eabi-objcopy -O ihex "${BuildArtifactFileBaseName}.elf" "${BuildArtifactFileBaseName}.hex" && arm-none-eabi-size "${BuildArtifactFileName}"">
|
||||||
|
|
||||||
<folderInfo id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.1502405410." name="/" resourcePath="">
|
<folderInfo id="fr.ac6.managedbuild.config.gnu.cross.exe.debug.1502405410." name="/" resourcePath="">
|
||||||
|
|
||||||
@ -129,7 +129,7 @@
|
|||||||
|
|
||||||
<listOptionValue builtIn="false" value="__packed=__attribute__((__packed__))"/>
|
<listOptionValue builtIn="false" value="__packed=__attribute__((__packed__))"/>
|
||||||
|
|
||||||
<listOptionValue builtIn="false" value="__packed="__attribute__((__packed__))"" /></option>
|
</option>
|
||||||
|
|
||||||
<option id="fr.ac6.managedbuild.gnu.c.compiler.option.misc.other.10179012" superClass="fr.ac6.managedbuild.gnu.c.compiler.option.misc.other" useByScannerDiscovery="false" value="-fmessage-length=0" valueType="string"/>
|
<option id="fr.ac6.managedbuild.gnu.c.compiler.option.misc.other.10179012" superClass="fr.ac6.managedbuild.gnu.c.compiler.option.misc.other" useByScannerDiscovery="false" value="-fmessage-length=0" valueType="string"/>
|
||||||
|
|
||||||
@ -305,9 +305,9 @@
|
|||||||
|
|
||||||
<option id="fr.ac6.managedbuild.option.gnu.cross.prefix.88691778.6334966" name="Prefix" superClass="fr.ac6.managedbuild.option.gnu.cross.prefix.88691778"/>
|
<option id="fr.ac6.managedbuild.option.gnu.cross.prefix.88691778.6334966" name="Prefix" superClass="fr.ac6.managedbuild.option.gnu.cross.prefix.88691778"/>
|
||||||
|
|
||||||
<option id="fr.ac6.managedbuild.option.gnu.cross.mcu.112180732.764162319" name="Mcu" superClass="fr.ac6.managedbuild.option.gnu.cross.mcu.112180732" value="STM32G431CBUx" />
|
<option id="fr.ac6.managedbuild.option.gnu.cross.mcu.112180732.764162319" name="Mcu" superClass="fr.ac6.managedbuild.option.gnu.cross.mcu.112180732"/>
|
||||||
|
|
||||||
<option id="fr.ac6.managedbuild.option.gnu.cross.board.1874862682.268364558" name="Board" superClass="fr.ac6.managedbuild.option.gnu.cross.board.1874862682" value="VNA_embedded" />
|
<option id="fr.ac6.managedbuild.option.gnu.cross.board.1874862682.268364558" name="Board" superClass="fr.ac6.managedbuild.option.gnu.cross.board.1874862682"/>
|
||||||
|
|
||||||
<option id="fr.ac6.managedbuild.option.gnu.cross.core.1083960614.1003751413" name="Core" superClass="fr.ac6.managedbuild.option.gnu.cross.core.1083960614"/>
|
<option id="fr.ac6.managedbuild.option.gnu.cross.core.1083960614.1003751413" name="Core" superClass="fr.ac6.managedbuild.option.gnu.cross.core.1083960614"/>
|
||||||
|
|
||||||
@ -785,7 +785,7 @@
|
|||||||
|
|
||||||
<configuration configurationName="Debug">
|
<configuration configurationName="Debug">
|
||||||
|
|
||||||
<resource resourceType="PROJECT" workspacePath="VNA_embedded" />
|
<resource resourceType="PROJECT" workspacePath="/VNA_embedded"/>
|
||||||
|
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|
||||||
|
@ -40,7 +40,6 @@ extern ADC_HandleTypeDef hadc1;
|
|||||||
|
|
||||||
#define FLAG_USB_PACKET 0x01
|
#define FLAG_USB_PACKET 0x01
|
||||||
#define FLAG_DATAPOINT 0x02
|
#define FLAG_DATAPOINT 0x02
|
||||||
#define FLAG_WORK_REQUIRED 0x04
|
|
||||||
|
|
||||||
static void VNACallback(Protocol::Datapoint res) {
|
static void VNACallback(Protocol::Datapoint res) {
|
||||||
result = res;
|
result = res;
|
||||||
@ -54,11 +53,6 @@ static void USBPacketReceived(Protocol::PacketInfo p) {
|
|||||||
xTaskNotifyFromISR(handle, FLAG_USB_PACKET, eSetBits, &woken);
|
xTaskNotifyFromISR(handle, FLAG_USB_PACKET, eSetBits, &woken);
|
||||||
portYIELD_FROM_ISR(woken);
|
portYIELD_FROM_ISR(woken);
|
||||||
}
|
}
|
||||||
static void HardwareWorkRequired() {
|
|
||||||
BaseType_t woken = false;
|
|
||||||
xTaskNotifyFromISR(handle, FLAG_WORK_REQUIRED, eSetBits, &woken);
|
|
||||||
portYIELD_FROM_ISR(woken);
|
|
||||||
}
|
|
||||||
|
|
||||||
void App_Start() {
|
void App_Start() {
|
||||||
STM::Init();
|
STM::Init();
|
||||||
@ -101,7 +95,7 @@ void App_Start() {
|
|||||||
EN_6V_GPIO_Port->BSRR = EN_6V_Pin;
|
EN_6V_GPIO_Port->BSRR = EN_6V_Pin;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!HW::Init(HardwareWorkRequired)) {
|
if (!HW::Init()) {
|
||||||
LOG_CRIT("Initialization failed, unable to start");
|
LOG_CRIT("Initialization failed, unable to start");
|
||||||
LED::Error(4);
|
LED::Error(4);
|
||||||
}
|
}
|
||||||
@ -119,9 +113,6 @@ void App_Start() {
|
|||||||
uint32_t notification;
|
uint32_t notification;
|
||||||
if(xTaskNotifyWait(0x00, UINT32_MAX, ¬ification, 100) == pdPASS) {
|
if(xTaskNotifyWait(0x00, UINT32_MAX, ¬ification, 100) == pdPASS) {
|
||||||
// something happened
|
// something happened
|
||||||
if(notification & FLAG_WORK_REQUIRED) {
|
|
||||||
HW::Work();
|
|
||||||
}
|
|
||||||
if(notification & FLAG_DATAPOINT) {
|
if(notification & FLAG_DATAPOINT) {
|
||||||
Protocol::PacketInfo packet;
|
Protocol::PacketInfo packet;
|
||||||
packet.type = Protocol::PacketType::Datapoint;
|
packet.type = Protocol::PacketType::Datapoint;
|
||||||
@ -217,7 +208,7 @@ void App_Start() {
|
|||||||
LOG_WARN("Timed out waiting for point, last received point was %d (Status 0x%04x)", result.pointNum, FPGA::GetStatus());
|
LOG_WARN("Timed out waiting for point, last received point was %d (Status 0x%04x)", result.pointNum, FPGA::GetStatus());
|
||||||
FPGA::AbortSweep();
|
FPGA::AbortSweep();
|
||||||
// restart the current sweep
|
// restart the current sweep
|
||||||
HW::Init(HardwareWorkRequired);
|
HW::Init();
|
||||||
HW::Ref::update();
|
HW::Ref::update();
|
||||||
VNA::Setup(settings, VNACallback);
|
VNA::Setup(settings, VNACallback);
|
||||||
sweepActive = true;
|
sweepActive = true;
|
||||||
|
@ -30,8 +30,6 @@ static void HaltedCallback() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static HW::WorkRequest requestWork;
|
|
||||||
|
|
||||||
static void ReadComplete(FPGA::SamplingResult result) {
|
static void ReadComplete(FPGA::SamplingResult result) {
|
||||||
bool needs_work = false;
|
bool needs_work = false;
|
||||||
switch(activeMode) {
|
switch(activeMode) {
|
||||||
@ -47,8 +45,8 @@ static void ReadComplete(FPGA::SamplingResult result) {
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(needs_work && requestWork) {
|
if(needs_work) {
|
||||||
STM::DispatchToInterrupt(requestWork);
|
STM::DispatchToInterrupt(HW::Work);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,8 +70,7 @@ void HW::Work() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HW::Init(WorkRequest wr) {
|
bool HW::Init() {
|
||||||
requestWork = wr;
|
|
||||||
LOG_DEBUG("Initializing...");
|
LOG_DEBUG("Initializing...");
|
||||||
|
|
||||||
activeMode = Mode::Idle;
|
activeMode = Mode::Idle;
|
||||||
@ -189,7 +186,7 @@ void HW::SetMode(Mode mode) {
|
|||||||
}
|
}
|
||||||
if(mode != Mode::Idle && activeMode != Mode::Idle) {
|
if(mode != Mode::Idle && activeMode != Mode::Idle) {
|
||||||
// do a full initialization when switching directly between modes
|
// do a full initialization when switching directly between modes
|
||||||
HW::Init(requestWork);
|
HW::Init();
|
||||||
}
|
}
|
||||||
SetIdle();
|
SetIdle();
|
||||||
activeMode = mode;
|
activeMode = mode;
|
||||||
|
@ -33,9 +33,7 @@ enum class Mode {
|
|||||||
SA,
|
SA,
|
||||||
};
|
};
|
||||||
|
|
||||||
using WorkRequest = void (*)(void);
|
bool Init();
|
||||||
|
|
||||||
bool Init(WorkRequest wr);
|
|
||||||
void SetMode(Mode mode);
|
void SetMode(Mode mode);
|
||||||
void SetIdle();
|
void SetIdle();
|
||||||
void Work();
|
void Work();
|
||||||
|
Loading…
Reference in New Issue
Block a user