Full init when switching to any other mode than idle
This commit is contained in:
parent
641f4ccd98
commit
978842a2ff
@ -97,7 +97,6 @@ void App_Start() {
|
|||||||
USB_EN_GPIO_Port->BSRR = USB_EN_Pin;
|
USB_EN_GPIO_Port->BSRR = USB_EN_Pin;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint32_t lastNewPoint = HAL_GetTick();
|
|
||||||
bool sweepActive = false;
|
bool sweepActive = false;
|
||||||
|
|
||||||
LED::Off();
|
LED::Off();
|
||||||
@ -110,7 +109,6 @@ void App_Start() {
|
|||||||
case Protocol::PacketType::SweepSettings:
|
case Protocol::PacketType::SweepSettings:
|
||||||
LOG_INFO("New settings received");
|
LOG_INFO("New settings received");
|
||||||
sweepActive = VNA::Setup(recv_packet.settings);
|
sweepActive = VNA::Setup(recv_packet.settings);
|
||||||
lastNewPoint = HAL_GetTick();
|
|
||||||
Communication::SendWithoutPayload(Protocol::PacketType::Ack);
|
Communication::SendWithoutPayload(Protocol::PacketType::Ack);
|
||||||
break;
|
break;
|
||||||
case Protocol::PacketType::ManualControl:
|
case Protocol::PacketType::ManualControl:
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
void Generator::Setup(Protocol::GeneratorSettings g) {
|
void Generator::Setup(Protocol::GeneratorSettings g) {
|
||||||
if(g.activePort == 0) {
|
if(g.activePort == 0) {
|
||||||
// both ports disabled, no need to configure PLLs
|
// both ports disabled, no need to configure PLLs
|
||||||
HW::SetMode(HW::Mode::Idle);
|
HW::SetIdle();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Protocol::ManualControl m;
|
Protocol::ManualControl m;
|
||||||
|
@ -192,7 +192,7 @@ void HW::SetMode(Mode mode) {
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(mode != Mode::Idle && activeMode != Mode::Idle) {
|
if(mode != Mode::Idle) {
|
||||||
// do a full initialization when switching directly between modes
|
// do a full initialization when switching directly between modes
|
||||||
HW::Init();
|
HW::Init();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user