Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling adi_ultrasonic_get hangs the program #197

Closed
Octogonapus opened this issue Jan 13, 2020 · 1 comment · Fixed by #245
Closed

Calling adi_ultrasonic_get hangs the program #197

Octogonapus opened this issue Jan 13, 2020 · 1 comment · Fixed by #245
Labels
bug Something isn't working p: low Low priority workaround available There is a workaround available for this bug

Comments

@Octogonapus
Copy link
Contributor

Octogonapus commented Jan 13, 2020

Expected Behavior:

Calling adi_ultrasonic_get should read the ultrasonic and return the value like normal.

Actual Behavior:

Calling adi_ultrasonic_get hangs the program.

Steps to reproduce:

Run this code:

void opcontrol() {
    pros::c::adi_ultrasonic sonic = pros::c::adi_ultrasonic_init(7, 8);
    printf("Errno %d:%s\n", errno, strerror(errno));
  while(true) {
    std::cout << pros::c::adi_ultrasonic_get(sonic) << '\n';
        ;
    pros::delay(20);
  }
}

System information:

Platform: V5
PROS Kernel Version: v3.2.0

Additional Information

Ok so with yellow input on 7 and orange output on 8 both the cpp and c api do not work. The cpp api gives me a 0 and the c api doesn't 'run'. With yellow input on 8 and orange output on 7, the c api does not 'run', but the cpp api does work. With all 4 of these tests the ping is set to 7 and the echo is set to 8.

@nathan-moore
Copy link
Member

From a preliminary look, it likely hangs in vexDeviceAdiPortConfigGet, as that's the only difference I see between the c and c++ apis.

@nathan-moore nathan-moore self-assigned this Jan 13, 2020
@nathan-moore nathan-moore added bug Something isn't working p: low Low priority workaround available There is a workaround available for this bug labels Jan 14, 2020
@nathan-moore nathan-moore removed their assignment Jul 7, 2020
@WillXuCodes WillXuCodes linked a pull request Aug 31, 2020 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p: low Low priority workaround available There is a workaround available for this bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants