Skip to content

Commit

Permalink
fix static analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
finger563 committed Feb 28, 2024
1 parent 4c1cbab commit 26996ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions components/hid-rp/include/hid-rp-gamepad.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include <algorithm>

#include "hid-rp.hpp"

namespace espp {
Expand Down Expand Up @@ -57,12 +59,8 @@ class GamepadReport : public hid::report::base<hid::report::type::INPUT, REPORT_
public:
/// Reset the gamepad inputs
constexpr void reset() {
for (auto &axis : joystick_axes) {
axis = joystick_center;
}
for (auto &axis : trigger_axes) {
axis = trigger_center;
}
std::fill(joystick_axes.begin(), joystick_axes.end(), joystick_center);
std::fill(trigger_axes.begin(), trigger_axes.end(), trigger_center);
set_hat(Hat::CENTERED);
buttons.reset();
}
Expand Down
2 changes: 1 addition & 1 deletion components/hid-rp/include/hid/page/button.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ template <> struct info<button> {
class button {
public:
constexpr operator usage_id_t() const { return id; }
constexpr button(std::uint8_t value)
explicit constexpr button(std::uint8_t value)
: id(value) {}
std::uint8_t id{};
};
Expand Down

0 comments on commit 26996ce

Please sign in to comment.