Skip to content

Conversation

@fipsi7
Copy link

@fipsi7 fipsi7 commented Apr 9, 2025

Fixes renode/renode#786

The current check for the LED Duty Cycle isn't correct.

Because of the check at the beginning:
in src/Emulator/Main/Testing/LEDTester.cs

ValidateArgument(expectedDutyCycle, nameof(expectedDutyCycle), min: 0, max: 1);
ValidateArgument(tolerance, nameof(tolerance), min: 0, max: 1);

This

if(highPercentage < expectedDutyCycle - (tolerance * 100) || expectedDutyCycle > expectedDutyCycle + (tolerance * 100))

should be this:

if(highPercentage < ((expectedDutyCycle - tolerance) * 100) || highPercentage > ((expectedDutyCycle + tolerance) * 100))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LED Tester AssertDutyCycle always passes

1 participant