Trim out a ton of debugging statements that are too verbose to be useful now.
This commit is contained in:
parent
29d1c4a556
commit
ec86cf44d6
24
Joystick.cpp
24
Joystick.cpp
|
@ -32,8 +32,6 @@ Joystick::Joystick(bool debug) {
|
|||
void Joystick::Init() {
|
||||
Serial.begin(115200);
|
||||
delay(100);
|
||||
|
||||
if (_debug) Serial.println("DEBUG: Joystick library initialized.");
|
||||
}
|
||||
|
||||
void Joystick::AddButton(uint8_t pin, ButtonType type, bool pullup) {
|
||||
|
@ -49,23 +47,11 @@ void Joystick::AddButton(uint8_t pin, ButtonType type, bool pullup) {
|
|||
_num_buttons++;
|
||||
|
||||
if (type & _BUTTON_PULSED_TYPES) _have_pulsed_button = true;
|
||||
|
||||
if (_debug) {
|
||||
Serial.print("Debug: added button of type ");
|
||||
Serial.print(type);
|
||||
Serial.print(" on digital pin ");
|
||||
Serial.println(pin);
|
||||
}
|
||||
}
|
||||
|
||||
void Joystick::AddAxis(uint8_t pin) {
|
||||
_axes[_num_axes] = pin;
|
||||
_num_axes++;
|
||||
|
||||
if (_debug) {
|
||||
Serial.print("Debug: added axis on analog pin ");
|
||||
Serial.println(pin);
|
||||
}
|
||||
}
|
||||
|
||||
void Joystick::Update() {
|
||||
|
@ -91,7 +77,6 @@ void Joystick::Update() {
|
|||
void Joystick::SetAxis(uint8_t axis, int16_t value) {
|
||||
if (axis >= JOYSTICK_NUM_AXES) return;
|
||||
_joyReport.axis[axis] = value;
|
||||
if (_debug) Serial.println("DEBUG: Axis change recorded.");
|
||||
}
|
||||
|
||||
void Joystick::PressButton(uint8_t button) {
|
||||
|
@ -99,10 +84,6 @@ void Joystick::PressButton(uint8_t button) {
|
|||
uint8_t byte = button / 8;
|
||||
uint8_t bit = button % 8;
|
||||
_joyReport.button[byte] |= 1 << bit;
|
||||
if (_debug) {
|
||||
Serial.print("DEBUG: Button press recorded for button ");
|
||||
Serial.println(button);
|
||||
}
|
||||
}
|
||||
|
||||
void Joystick::ReleaseButton(uint8_t button) {
|
||||
|
@ -110,17 +91,12 @@ void Joystick::ReleaseButton(uint8_t button) {
|
|||
uint8_t byte = button / 8;
|
||||
uint8_t bit = button % 8;
|
||||
_joyReport.button[byte] &= ~(1 << bit);
|
||||
if (_debug) {
|
||||
Serial.print("DEBUG: Button release recorded for button ");
|
||||
Serial.println(button);
|
||||
}
|
||||
}
|
||||
|
||||
void Joystick::ReleaseAllButtons() {
|
||||
for (uint8_t i = 0; i < JOYSTICK_NUM_BYTES; i++) {
|
||||
_joyReport.button[i] = 0;
|
||||
}
|
||||
if (_debug) Serial.println("DEBUG: All-button release recorded.");
|
||||
}
|
||||
|
||||
void Joystick::_ReleasePulsedButtons() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user