Skip to content

Commit

Permalink
Chaos modules: after flipping one of the XYZ output polarities, clear…
Browse files Browse the repository at this point in the history
… Tricorder display.
  • Loading branch information
cosinekitty committed Dec 2, 2024
1 parent 19cceb2 commit f222297
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/sapphire_chaos_module.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ namespace Sapphire
bool turboMode = false;
ChaosOperators::Receiver receiver;
ChaoticOscillatorState memory[ChaosOperators::MemoryCount];
bool shouldClearTricorder = false;

ChaosModule()
: SapphireModule(PARAMS_LEN, OUTPUTS_LEN)
Expand Down
8 changes: 7 additions & 1 deletion src/sapphire_vcvrack.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@ namespace Sapphire
bool enableLimiterWarning = true;
int limiterRecoveryCountdown = 0; // positive integer indicates we are recovering from NAN/INF
int currentChannelCount = 0; // used only by modules that display a channel count on the panel
bool shouldClearTricorder = false; // used only by modules that send vectors to Tricorder for display

explicit SapphireModule(std::size_t nParams, std::size_t nOutputPorts)
: vectorSender(*this)
Expand Down Expand Up @@ -909,7 +910,12 @@ namespace Sapphire

void setVoltageFlipEnabled(int outputId, bool state)
{
outputPortInfo.at(outputId).flipVoltagePolarity = state;
bool& flip = outputPortInfo.at(outputId).flipVoltagePolarity;
if (flip != state)
{
flip = state;
shouldClearTricorder = true;
}
}

float setFlippableOutputVoltage(int outputId, float originalVoltage)
Expand Down

0 comments on commit f222297

Please sign in to comment.