Skip to content

Commit

Permalink
[wpilib] Increase time between interrupt operations (wpilibsuite#6848)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gold856 authored Jul 18, 2024
1 parent 15001af commit 34b8b7a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions wpilibc/src/test/native/cpp/InterruptTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ TEST(InterruptTest, AsynchronousInterrupt) {
frc::Wait(0.5_s);
DIOSim digitalSim{di};
digitalSim.SetValue(false);
frc::Wait(10_ms);
frc::Wait(20_ms);
digitalSim.SetValue(true);
frc::Wait(10_ms);
frc::Wait(20_ms);

int count = 0;
while (!hasFired) {
Expand All @@ -59,9 +59,9 @@ TEST(InterruptTest, RisingEdge) {
digitalSim.SetValue(false);
frc::Wait(0.5_s);
interrupt.Enable();
frc::Wait(10_ms);
frc::Wait(20_ms);
digitalSim.SetValue(true);
frc::Wait(10_ms);
frc::Wait(20_ms);

int count = 0;
while (!hasFiredRisingEdge) {
Expand Down Expand Up @@ -89,9 +89,9 @@ TEST(InterruptTest, FallingEdge) {
digitalSim.SetValue(true);
frc::Wait(0.5_s);
interrupt.Enable();
frc::Wait(10_ms);
frc::Wait(20_ms);
digitalSim.SetValue(false);
frc::Wait(10_ms);
frc::Wait(20_ms);

int count = 0;
while (!hasFiredFallingEdge) {
Expand Down
12 changes: 6 additions & 6 deletions wpilibj/src/test/java/edu/wpi/first/wpilibj/InterruptTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ void testAsynchronousInterrupt() {
Timer.delay(0.5);
DIOSim digitalSim = new DIOSim(di);
digitalSim.setValue(false);
Timer.delay(0.01);
Timer.delay(0.02);
digitalSim.setValue(true);
Timer.delay(0.01);
Timer.delay(0.02);

int count = 0;
while (!hasFired.get()) {
Expand Down Expand Up @@ -64,9 +64,9 @@ void testRisingEdge() {
digitalSim.setValue(false);
Timer.delay(0.5);
interrupt.enable();
Timer.delay(0.01);
Timer.delay(0.02);
digitalSim.setValue(true);
Timer.delay(0.01);
Timer.delay(0.02);

int count = 0;
while (!hasFiredRisingEdge.get()) {
Expand Down Expand Up @@ -101,9 +101,9 @@ void testFallingEdge() {
digitalSim.setValue(true);
Timer.delay(0.5);
interrupt.enable();
Timer.delay(0.01);
Timer.delay(0.02);
digitalSim.setValue(false);
Timer.delay(0.01);
Timer.delay(0.02);

int count = 0;
while (!hasFiredFallingEdge.get()) {
Expand Down

0 comments on commit 34b8b7a

Please sign in to comment.