evaluate AUX3 in standby state
This commit is contained in:
parent
fc8eee58e7
commit
ec5e0e208c
@ -284,6 +284,10 @@ bool FPGA::InitiateSampleRead(ReadCallback cb) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool FPGA::IsSweepActive() {
|
||||||
|
return isHigh(AUX3);
|
||||||
|
}
|
||||||
|
|
||||||
static int64_t assembleSampleResultValue(uint8_t *raw) {
|
static int64_t assembleSampleResultValue(uint8_t *raw) {
|
||||||
// LOG_DEBUG("Raw: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x", raw[4], raw[5], raw[2], raw[3], raw[1], raw[0]);
|
// LOG_DEBUG("Raw: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x", raw[4], raw[5], raw[2], raw[3], raw[1], raw[0]);
|
||||||
return sign_extend_64(
|
return sign_extend_64(
|
||||||
|
@ -135,6 +135,7 @@ ADCLimits GetADCLimits();
|
|||||||
void ResetADCLimits();
|
void ResetADCLimits();
|
||||||
bool ResumeHaltedSweep();
|
bool ResumeHaltedSweep();
|
||||||
uint16_t GetStatus();
|
uint16_t GetStatus();
|
||||||
|
bool IsSweepActive();
|
||||||
|
|
||||||
void OverwriteHardware(uint8_t attenuation, LowpassFilter filter, bool lowband, bool port1_enabled, bool port2_enabled);
|
void OverwriteHardware(uint8_t attenuation, LowpassFilter filter, bool lowband, bool port1_enabled, bool port2_enabled);
|
||||||
void DisableHardwareOverwrite();
|
void DisableHardwareOverwrite();
|
||||||
|
@ -303,7 +303,7 @@ bool HW::TimedOut() {
|
|||||||
auto bufISR = lastISR;
|
auto bufISR = lastISR;
|
||||||
uint64_t now = Delay::get_us();
|
uint64_t now = Delay::get_us();
|
||||||
uint64_t timeSinceLast = now - bufISR;
|
uint64_t timeSinceLast = now - bufISR;
|
||||||
if(activeMode != Mode::Idle && activeMode != Mode::Generator && !VNA::GetStandbyMode() && timeSinceLast > timeout) {
|
if(activeMode != Mode::Idle && activeMode != Mode::Generator && !VNA::IsWaitingInStandby() && timeSinceLast > timeout) {
|
||||||
LOG_WARN("Timed out, last ISR was at %lu%06lu, now %lu%06lu"
|
LOG_WARN("Timed out, last ISR was at %lu%06lu, now %lu%06lu"
|
||||||
, (uint32_t) (bufISR / 1000000), (uint32_t)(bufISR%1000000)
|
, (uint32_t) (bufISR / 1000000), (uint32_t)(bufISR%1000000)
|
||||||
, (uint32_t) (now / 1000000), (uint32_t)(now%1000000));
|
, (uint32_t) (now / 1000000), (uint32_t)(now%1000000));
|
||||||
|
@ -278,6 +278,10 @@ bool VNA::GetStandbyMode() {
|
|||||||
return settings.standby;
|
return settings.standby;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool VNA::IsWaitingInStandby() {
|
||||||
|
return settings.standby && !FPGA::IsSweepActive();
|
||||||
|
}
|
||||||
|
|
||||||
static void PassOnData() {
|
static void PassOnData() {
|
||||||
Protocol::PacketInfo info;
|
Protocol::PacketInfo info;
|
||||||
info.type = Protocol::PacketType::VNADatapoint;
|
info.type = Protocol::PacketType::VNADatapoint;
|
||||||
|
@ -9,6 +9,7 @@ namespace VNA {
|
|||||||
bool Setup(Protocol::SweepSettings s);
|
bool Setup(Protocol::SweepSettings s);
|
||||||
void InitiateSweep();
|
void InitiateSweep();
|
||||||
bool GetStandbyMode();
|
bool GetStandbyMode();
|
||||||
|
bool IsWaitingInStandby();
|
||||||
bool MeasurementDone(const FPGA::SamplingResult &result);
|
bool MeasurementDone(const FPGA::SamplingResult &result);
|
||||||
void Work();
|
void Work();
|
||||||
void SweepHalted();
|
void SweepHalted();
|
||||||
|
Loading…
Reference in New Issue
Block a user