Code cleanup
This commit is contained in:
parent
8ba920c0d3
commit
fe887a2d62
@ -3,7 +3,7 @@
|
|||||||
* Date: 2023-09-02
|
* Date: 2023-09-02
|
||||||
* Author: Christoffer Martinsson
|
* Author: Christoffer Martinsson
|
||||||
* Email: cm@cmtec.se
|
* Email: cm@cmtec.se
|
||||||
* License: Please refer to end of this file for license information
|
* License: Please refer to LICENSE file in root folder
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ElrsTx.h"
|
#include "ElrsTx.h"
|
||||||
@ -203,12 +203,9 @@ void calibrate_axis(int analog_x1, int analog_y1, int analog_x2, int analog_y2)
|
|||||||
joystick_y2_12bit = AXIS_12BIT_CENTER;
|
joystick_y2_12bit = AXIS_12BIT_CENTER;
|
||||||
|
|
||||||
// Check for calibration mode
|
// Check for calibration mode
|
||||||
if (joystick_calibration_mode == CALIBRATION_INIT)
|
if (joystick_calibration_mode == CALIBRATION_INIT && digitalRead(BUTTON_TOP_LEFT_LOWER_PIN) == BUTTON_NOT_PRESSED)
|
||||||
{
|
{
|
||||||
if (digitalRead(BUTTON_TOP_LEFT_LOWER_PIN) == BUTTON_NOT_PRESSED)
|
joystick_calibration_mode = CALIBRATION_CENTER;
|
||||||
{
|
|
||||||
joystick_calibration_mode = CALIBRATION_CENTER;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calibrate joystick center values
|
// Calibrate joystick center values
|
||||||
@ -595,33 +592,3 @@ void loop()
|
|||||||
indicator_timestamp_micros = current_timestamp_micros + TIME_US_200ms;
|
indicator_timestamp_micros = current_timestamp_micros + TIME_US_200ms;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* @License
|
|
||||||
* =======================================================================================================
|
|
||||||
* -------------------------------------------------------------------------------------------------------
|
|
||||||
* ---####################-----###########-------###########-----############--############-############--
|
|
||||||
* --######################---#############-----#############---- -- - ---
|
|
||||||
* --###### ##---##### ###-----### #####---------##-------#######------#-------------
|
|
||||||
* -- -------------- --- ----- --- ----- ---------##-------#------------#-------------
|
|
||||||
* --#####--------------------#####------####-####------#####---------##-------###########--############--
|
|
||||||
* -- -------------------- ------ ------ --------- ------- -- --
|
|
||||||
* --#####--------------------#####--------#####--------#####---------------------------------------------
|
|
||||||
* -- -------------------- -------- -------- ---------------------------------------------
|
|
||||||
* --######--------------##---#####---------------------#####---------------------------------------------
|
|
||||||
* --##################### ---#####---------------------#####---------------------------------------------
|
|
||||||
* ---################### ----#####---------------------#####---------------------------------------------
|
|
||||||
* --- ----- --------------------- ---------------------------------------------
|
|
||||||
* -------------------------------------------------------------------------------------------------------
|
|
||||||
* =======================================================================================================
|
|
||||||
*
|
|
||||||
* Copyright 2022 Christoffer Martinsson <cm@cmtec.se>
|
|
||||||
*
|
|
||||||
* CMtec CMDR Joystick RC can be redistributed and/or modified under the terms of the GNU General
|
|
||||||
* Public License (Version 2), as published by the Free Software Foundation.
|
|
||||||
* A copy of the license can be found online at www.gnu.o urg/licenses.
|
|
||||||
*
|
|
||||||
* CMtec CMDR Joystick RC is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
||||||
* A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* Joystick based on standard teensy "usb_joystick" library for HID joystick usb data communication.
|
|
||||||
*/
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user