Code cleanup
This commit is contained in:
parent
8ba920c0d3
commit
fe887a2d62
@ -3,7 +3,7 @@
|
||||
* Date: 2023-09-02
|
||||
* Author: Christoffer Martinsson
|
||||
* 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"
|
||||
@ -203,13 +203,10 @@ void calibrate_axis(int analog_x1, int analog_y1, int analog_x2, int analog_y2)
|
||||
joystick_y2_12bit = AXIS_12BIT_CENTER;
|
||||
|
||||
// Check for calibration mode
|
||||
if (joystick_calibration_mode == CALIBRATION_INIT)
|
||||
{
|
||||
if (digitalRead(BUTTON_TOP_LEFT_LOWER_PIN) == BUTTON_NOT_PRESSED)
|
||||
if (joystick_calibration_mode == CALIBRATION_INIT && digitalRead(BUTTON_TOP_LEFT_LOWER_PIN) == BUTTON_NOT_PRESSED)
|
||||
{
|
||||
joystick_calibration_mode = CALIBRATION_CENTER;
|
||||
}
|
||||
}
|
||||
|
||||
// Calibrate joystick center values
|
||||
else if (joystick_calibration_mode == CALIBRATION_CENTER)
|
||||
@ -595,33 +592,3 @@ void loop()
|
||||
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