Skip to content

Commit

Permalink
fix: 🚧 it might work
Browse files Browse the repository at this point in the history
testing in the vexide sim did not result in any errors, idk why
  • Loading branch information
PA055 committed Sep 25, 2024
1 parent 466b8e1 commit 9bfcbb3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion include/gamepad/screens/defaultScreen.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class DefaultScreen : public AbstractScreen {
void rumble(std::string rumble_pattern);

private:
ScreenBuffer currentBuffer{std::nullopt, std::nullopt, std::nullopt, std::nullopt};
ScreenBuffer currentBuffer;
pros::Mutex mut;

};
Expand Down
10 changes: 5 additions & 5 deletions src/gamepad/screens/defaultScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@

namespace Gamepad {

DefaultScreen::DefaultScreen() : AbstractScreen(1) {
DefaultScreen::DefaultScreen() : AbstractScreen(1), currentBuffer({}) {
printf("ran constructor\n");
}

ScreenBuffer DefaultScreen::get_screen(std::set<uint8_t> visible_lines) {
ScreenBuffer output;
printf("{%s, %s, %s, %s}\n",
currentBuffer.at(0).value_or("N/A").c_str(),
currentBuffer.at(1).value_or("N/A").c_str(),
currentBuffer.at(2).value_or("N/A").c_str(),
currentBuffer.at(3).value_or("N/A").c_str());
currentBuffer.at(0).value_or("nullopt").c_str(),
currentBuffer.at(1).value_or("nullopt").c_str(),
currentBuffer.at(2).value_or("nullopt").c_str(),
currentBuffer.at(3).value_or("nullopt").c_str());
// const std::lock_guard<pros::Mutex> guard(this->mut);
for (auto i = visible_lines.begin(); i != visible_lines.end(); ++i) {
output[*i] = std::move(this->currentBuffer[*i].value_or(""));
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void opcontrol() {
// Remember to ALWAYS call update at the start of your while loop!
Gamepad::master.update();

// Gamepad::master.print_line(0, "hello\n\nhi");
Gamepad::master.print_line(0, "hello\n\nhi");

pros::delay(25); // Wait for 25 ms, then update the motor values again
}
Expand Down

0 comments on commit 9bfcbb3

Please sign in to comment.