[Horus] First fixes on the real radio
This commit is contained in:
@@ -1,23 +1,23 @@
|
||||
/*
|
||||
* Copyright (C) OpenTX
|
||||
*
|
||||
* Based on code named
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) OpenTX
|
||||
*
|
||||
* Based on code named
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program 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.
|
||||
*/
|
||||
|
||||
#include "../../opentx.h"
|
||||
|
||||
#define ADC_CS_HIGH() (ADC_SPI_GPIO->BSRRL = ADC_SPI_PIN_CS)
|
||||
@@ -150,8 +150,8 @@ const uint16_t adcCommands[MOUSE1+2] =
|
||||
MANUAL_MODE | ( SPI_POT3 << 7 ),
|
||||
MANUAL_MODE | ( SPI_SLIDER1 << 7 ),
|
||||
MANUAL_MODE | ( SPI_SLIDER2 << 7 ),
|
||||
MANUAL_MODE | ( SPI_SLIDER3 << 7 ),
|
||||
MANUAL_MODE | ( SPI_SLIDER4 << 7 ),
|
||||
MANUAL_MODE | ( SPI_SLIDER3 << 7 ),
|
||||
MANUAL_MODE | ( SPI_TX_VOLTAGE << 7 ),
|
||||
MANUAL_MODE | ( 0 << 7 ),
|
||||
MANUAL_MODE | ( 0 << 7 )
|
||||
@@ -199,7 +199,12 @@ void adcRead()
|
||||
// On chip ADC read should have finished
|
||||
}
|
||||
|
||||
uint16_t getAnalogValue(uint32_t value)
|
||||
const int8_t ana_direction[NUMBER_ANALOG] = {1,-1,1,-1, -1,1,-1, 1,1, -1,-1, 0,0,0};
|
||||
|
||||
uint16_t getAnalogValue(uint32_t index)
|
||||
{
|
||||
return adcValues[value];
|
||||
if (ana_direction[index] < 0)
|
||||
return 4096 - adcValues[index];
|
||||
else
|
||||
return adcValues[index];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user