1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-25 17:25:13 +03:00

[Horus] First fixes on the real radio

This commit is contained in:
Bertrand Songis 2016-01-07 23:56:18 +01:00
parent bbe4e7d4c3
commit a43271c7a6
3 changed files with 31 additions and 25 deletions

View file

@ -814,6 +814,7 @@ if(CPU_FAMILY STREQUAL STM32)
add_custom_target(flash add_custom_target(flash
COMMAND dfu-util --alt 0 --dfuse-address 0x08000000 -D firmware.bin COMMAND dfu-util --alt 0 --dfuse-address 0x08000000 -D firmware.bin
DEPENDS firmware.bin DEPENDS firmware.bin
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
) )
endif() endif()

View file

@ -91,7 +91,7 @@ void drawVerticalStick(coord_t x, int val)
else else
lcdDrawSolidHorizontalLine(x+2, 56+i, 9, TEXT_COLOR); lcdDrawSolidHorizontalLine(x+2, 56+i, 9, TEXT_COLOR);
} }
drawVerticalTrimPosition(x, TRIM_V_Y+val*TRIM_LEN/RESX-6, val); drawVerticalTrimPosition(x, TRIM_V_Y-val*TRIM_LEN/RESX-6, val);
} }
void drawSticks() void drawSticks()
@ -145,7 +145,7 @@ void drawTrims(uint8_t flightMode)
drawHorizontalTrimPosition(xm-3, ym-2, val); drawHorizontalTrimPosition(xm-3, ym-2, val);
if (g_model.displayTrims != DISPLAY_TRIMS_NEVER && trim != 0) { if (g_model.displayTrims != DISPLAY_TRIMS_NEVER && trim != 0) {
if (g_model.displayTrims == DISPLAY_TRIMS_ALWAYS || (trimsDisplayTimer > 0 && (trimsDisplayMask & (1<<i)))) { if (g_model.displayTrims == DISPLAY_TRIMS_ALWAYS || (trimsDisplayTimer > 0 && (trimsDisplayMask & (1<<i)))) {
lcdDrawNumber((stickIndex==0 ? TRIM_LH_X : TRIM_RH_X)+(trim>0 ? -20 : 50), ym+2, trim, TINSIZE); lcdDrawNumber((stickIndex==0 ? TRIM_LH_X : TRIM_RH_X)+(trim>0 ? -20 : 50), ym+1, trim, TINSIZE);
} }
} }
} }

View file

@ -150,8 +150,8 @@ const uint16_t adcCommands[MOUSE1+2] =
MANUAL_MODE | ( SPI_POT3 << 7 ), MANUAL_MODE | ( SPI_POT3 << 7 ),
MANUAL_MODE | ( SPI_SLIDER1 << 7 ), MANUAL_MODE | ( SPI_SLIDER1 << 7 ),
MANUAL_MODE | ( SPI_SLIDER2 << 7 ), MANUAL_MODE | ( SPI_SLIDER2 << 7 ),
MANUAL_MODE | ( SPI_SLIDER3 << 7 ),
MANUAL_MODE | ( SPI_SLIDER4 << 7 ), MANUAL_MODE | ( SPI_SLIDER4 << 7 ),
MANUAL_MODE | ( SPI_SLIDER3 << 7 ),
MANUAL_MODE | ( SPI_TX_VOLTAGE << 7 ), MANUAL_MODE | ( SPI_TX_VOLTAGE << 7 ),
MANUAL_MODE | ( 0 << 7 ), MANUAL_MODE | ( 0 << 7 ),
MANUAL_MODE | ( 0 << 7 ) MANUAL_MODE | ( 0 << 7 )
@ -199,7 +199,12 @@ void adcRead()
// On chip ADC read should have finished // 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];
} }