Skip to content

Commit

Permalink
simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieucarbou committed Dec 28, 2024
1 parent 83f9f49 commit 27d67ca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/fn/yasolr_frequency.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

float yasolr_frequency() {
float frequency = round(grid.getFrequency().value_or(NAN));
if (!isnanf(frequency) && frequency)
if (frequency > 0)
return frequency;

frequency = round(pzemO1.data.frequency);
if (!isnanf(frequency) && frequency)
if (frequency > 0)
return frequency;

frequency = round(pzemO2.data.frequency);
if (!isnanf(frequency) && frequency)
if (frequency > 0)
return frequency;

frequency = config.getFloat(KEY_GRID_FREQUENCY);
Expand Down

0 comments on commit 27d67ca

Please sign in to comment.