Skip to content

Commit

Permalink
fix: 🐛 actually make it compile
Browse files Browse the repository at this point in the history
also run clang-format
  • Loading branch information
PA055 committed Nov 13, 2024
1 parent f70c9d6 commit 2a7ff7a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions include/gamepad/gamepad.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Gamepad {
*
* @param screen the `AbstractScreen` to add to the screen queue
*
* @b Example:
* @b Example:
* @code {.cpp}
* // initialize the alerts screen so we can have alerts on the controller
* std::shared_ptr<gamepad::AlertScreen> alerts = std::make_shared<gamepad::AlertScreen>();
Expand All @@ -46,7 +46,7 @@ class Gamepad {
void add_screen(std::shared_ptr<AbstractScreen> screen);
/**
* @brief print a line to the console like pros (low priority)
*
*
* @param line the line number to print the string on (0-2)
* @param str the string to print onto the controller (\n to go to the next line)
*
Expand Down
2 changes: 1 addition & 1 deletion src/gamepad/gamepad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void Gamepad::updateScreens() {
std::set<pros::controller_digital_e_t> buttonUpdates;
for (int i = pros::E_CONTROLLER_DIGITAL_L1; i <= pros::E_CONTROLLER_DIGITAL_A; ++i) {
if ((this->*this->button_to_ptr(static_cast<pros::controller_digital_e_t>(i))).rising_edge) {
buttonUpdates.emplace(static_cast<pros::controller_id_e_t>(i));
buttonUpdates.emplace(static_cast<pros::controller_digital_e_t>(i));
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ std::shared_ptr<gamepad::AlertScreen> alerts = std::make_shared<gamepad::AlertSc
* to keep execution time for this mode under a few seconds.
*/
void initialize() {
// VERY IMPORTANT, this actually adds the alerts screen to the gamepad
// VERY IMPORTANT, this actually adds the alerts screen to the gamepad
// it wouldnt work without this line
gamepad::master.add_screen(alerts);

// When the A button is pressed, schedule an alert that spans all three
// When the A button is pressed, schedule an alert that spans all three
// lines, lasts 3 seconds and rumbles in a long-short-long pattern
gamepad::master.A.onPress("alert", []() {
alerts->add_alerts(0, "a very\nimportant alert\nat " + std::to_string(pros::millis()) + " ms", 3000, "-.-");
Expand All @@ -31,7 +31,7 @@ void initialize() {
// the second line when the B button is pressed
gamepad::master.B.onPress(
"print02", []() { gamepad::master.print_line(0, "the time is\n\n" + std::to_string(pros::millis()) + " ms"); });

// rumbles 3 times for a short duration when the X button is pressed
gamepad::master.X.onPress("rumble", []() { gamepad::master.rumble("..."); });

Expand Down

0 comments on commit 2a7ff7a

Please sign in to comment.