Code cleanup
This commit is contained in:
parent
4709802879
commit
c6107321d6
@ -32,9 +32,9 @@
|
|||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include <EEPROM.h>
|
#include <EEPROM.h>
|
||||||
|
#include <ResponsiveAnalogRead.h>
|
||||||
#include "ElrsTx.h"
|
#include "ElrsTx.h"
|
||||||
#include "IndicatorLed.h"
|
#include "IndicatorLed.h"
|
||||||
#include "ResponsiveAnalogRead.h"
|
|
||||||
|
|
||||||
IndicatorLed status_led(13);
|
IndicatorLed status_led(13);
|
||||||
IndicatorLed button_led_1(22);
|
IndicatorLed button_led_1(22);
|
||||||
@ -42,12 +42,12 @@ IndicatorLed button_led_2(23);
|
|||||||
|
|
||||||
const int TIME_US_1ms = 1000;
|
const int TIME_US_1ms = 1000;
|
||||||
const int TIME_US_5ms = 5000;
|
const int TIME_US_5ms = 5000;
|
||||||
const long TIME_US_200ms = 200000;
|
const uint64_t TIME_US_200ms = 200000;
|
||||||
unsigned long current_timestamp_micros = 0;
|
uint64_t current_timestamp_micros = 0;
|
||||||
unsigned long process_data_timestamp_micros = 0;
|
uint64_t process_data_timestamp_micros = 0;
|
||||||
unsigned long indicator_timestamp_micros = 0;
|
uint64_t indicator_timestamp_micros = 0;
|
||||||
unsigned long send_usb_timestamp_micros = 0;
|
uint64_t send_usb_timestamp_micros = 0;
|
||||||
unsigned long send_elrs_timestamp_micros = 0;
|
uint64_t send_elrs_timestamp_micros = 0;
|
||||||
|
|
||||||
const int BUTTON_PRESSED = LOW;
|
const int BUTTON_PRESSED = LOW;
|
||||||
const int BUTTON_NOT_PRESSED = HIGH;
|
const int BUTTON_NOT_PRESSED = HIGH;
|
||||||
@ -393,7 +393,6 @@ void send_usb_data()
|
|||||||
*/
|
*/
|
||||||
int apply_calibration_12bit(int gimbal_value, int min_value, int max_value, int center_value, int deadband_value, int expo_value)
|
int apply_calibration_12bit(int gimbal_value, int min_value, int max_value, int center_value, int deadband_value, int expo_value)
|
||||||
{
|
{
|
||||||
|
|
||||||
int calibrated_value = AXIS_12BIT_CENTER;
|
int calibrated_value = AXIS_12BIT_CENTER;
|
||||||
|
|
||||||
if (gimbal_value > (center_value + deadband_value))
|
if (gimbal_value > (center_value + deadband_value))
|
||||||
@ -421,7 +420,6 @@ int apply_calibration_12bit(int gimbal_value, int min_value, int max_value, int
|
|||||||
*/
|
*/
|
||||||
void process_input_data()
|
void process_input_data()
|
||||||
{
|
{
|
||||||
|
|
||||||
int analog_x1_gimbal_value = 0;
|
int analog_x1_gimbal_value = 0;
|
||||||
int analog_y1_gimbal_value = 0;
|
int analog_y1_gimbal_value = 0;
|
||||||
int analog_x2_gimbal_value = 0;
|
int analog_x2_gimbal_value = 0;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user