forked from purduesigbots/pros
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: The delay in the `adi_gyro_init()` function called by the `pros::ADIGyro` ctor caused segfaults when creating a gyro object globally, since the scheduler hasn't started at that point. Closes T640. Test Plan: [x] Compiles [x] Run test code with a global gyro ctor and observe if/when the VexOS delay happens. Test code: ``` #include "main.h" pros::ADIGyro global_gyro ('a'); void opcontrol() { while (true) { pros::lcd::print(1, "%f", global_gyro.get_value()); pros::delay(20); } } ``` This displays `-32768.000000` for the 1300ms calibration time, then starts properly printing. For now we should just include a warning about this to users and encourage them to declare gyroscopes in a local scope, but this could be a good application for something along the lines of T635. Reviewers: O1 The Ori, berman5 Reviewed By: O1 The Ori, berman5 Subscribers: berman5 Tags: #zorp Maniphest Tasks: T640 Differential Revision: https://phabricator.purduesigbots.com/D201
- Loading branch information
Showing
3 changed files
with
19 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters