From 5322744f4213ee9384f0915d4e1737d86fb9cf25 Mon Sep 17 00:00:00 2001 From: annabunches Date: Mon, 1 Nov 2021 15:38:01 -0400 Subject: [PATCH] Revert to non-STL-using code, since that's not available when compiling for Arduino... --- Joystick.cpp | 16 +++++++++------- Joystick.h | 5 +++-- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Joystick.cpp b/Joystick.cpp index 9712454..de8e1e0 100644 --- a/Joystick.cpp +++ b/Joystick.cpp @@ -55,7 +55,8 @@ void Joystick::AddButton(uint8_t pin, ButtonType type, bool pullup) { // todo: fail here } - _buttons.push_back(button); + _buttons[_num_buttons] = button; + _num_buttons++; last_button_index += increment; if (type & _BUTTON_PULSED_TYPES) _have_pulsed_button = true; @@ -69,8 +70,8 @@ void Joystick::AddAxis(uint8_t pin) { void Joystick::Update() { JoyReport oldReport = _joyReport; - for (list