1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-26 01:35:21 +03:00

Cosmetics

This commit is contained in:
Bertrand Songis 2016-07-24 11:31:47 +02:00
parent e25db7e9e0
commit ab6c6babae
8 changed files with 23 additions and 47 deletions

View file

@ -468,5 +468,11 @@ if(CPU_FAMILY STREQUAL STM32)
DEPENDS firmware DEPENDS firmware
WORKING_DIRECTORY ${CMAKE_BINARY_DIR} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
) )
add_custom_target(jtag-flash
COMMAND st-flash --reset write firmware.bin 0x8000000
DEPENDS firmware
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
endif() endif()
endif() endif()

View file

@ -335,7 +335,7 @@ extern const char * debugTimerNames[DEBUG_TIMERS_COUNT];
#endif // #if defined(__cplusplus) #endif // #if defined(__cplusplus)
#define DEBUG_TIMER_START(timer) debugTimers[timer].start() #define DEBUG_TIMER_START(timer) debugTimers[timer].start()
#define DEBUG_TIMER_STOP(timer) debugTimers[timer].stop() #define DEBUG_TIMER_STOP(timer) debugTimers[timer].stop()
#define DEBUG_TIMER_SAMPLE(timer) debugTimers[timer].sample() #define DEBUG_TIMER_SAMPLE(timer) debugTimers[timer].sample()

View file

@ -1497,7 +1497,7 @@ union ReusableBuffer
} sdmanager; } sdmanager;
#endif #endif
#if defined(PCBTARANIS) #if defined(CPUSTM32)
struct struct
{ {
char id[27]; char id[27];

View file

@ -151,28 +151,6 @@ void getSwitchesPosition(bool startup)
CHECK_2POS(SW_SE); CHECK_2POS(SW_SE);
CHECK_3POS(1, SW_SF); CHECK_3POS(1, SW_SF);
switchesPos = newPos; switchesPos = newPos;
int i = 0;
StepsCalibData * calib = (StepsCalibData *) &g_eeGeneral.calib[POT1+i];
if (calib->count>0 && calib->count<XPOTS_MULTIPOS_COUNT) {
uint8_t pos = anaIn(POT1+i) / (2*RESX/calib->count);
uint8_t previousPos = potsPos[i] >> 4;
uint8_t previousStoredPos = potsPos[i] & 0x0F;
if (startup) {
potsPos[i] = (pos << 4) | pos;
}
else if (pos != previousPos) {
potsLastposStart[i] = get_tmr10ms();
potsPos[i] = (pos << 4) | previousStoredPos;
}
else if (g_eeGeneral.switchesDelay==SWITCHES_DELAY_NONE || (tmr10ms_t)(get_tmr10ms() - potsLastposStart[i]) > SWITCHES_DELAY()) {
potsLastposStart[i] = 0;
potsPos[i] = (pos << 4) | pos;
if (previousStoredPos != pos) {
PLAY_SWITCH_MOVED(SWSRC_LAST_SWITCH+i*XPOTS_MULTIPOS_COUNT+pos);
}
}
}
} }
#endif #endif

View file

@ -25,8 +25,8 @@
/*-----------------------------------------------------------------------*/ /*-----------------------------------------------------------------------*/
#include "diskio.h" #include "diskio.h"
#include <string.h> // memcpy #include <string.h>
#include "../../opentx.h" #include "opentx.h"
#include "sdio_sd.h" #include "sdio_sd.h"
#define BLOCK_SIZE 512 /* Block Size in Bytes */ #define BLOCK_SIZE 512 /* Block Size in Bytes */

View file

@ -18,9 +18,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
*/ */
/* Includes ------------------------------------------------------------------*/ #include "sdio_sd.h"
#include "../horus/sdio_sd.h"
#include "../../debug.h" #include "../../debug.h"
/** @addtogroup Utilities /** @addtogroup Utilities
@ -1152,12 +1150,10 @@ OPTIMIZE("O0") SD_Error SD_ReadBlock(uint8_t *readbuff, uint32_t ReadAddr, uint1
SD_LowLevel_DMA_RxConfig((uint32_t *)readbuff, BlockSize); SD_LowLevel_DMA_RxConfig((uint32_t *)readbuff, BlockSize);
#endif #endif
if (CardType == SDIO_HIGH_CAPACITY_SD_CARD) { if (CardType == SDIO_HIGH_CAPACITY_SD_CARD)
BlockSize = 512; BlockSize = 512;
} else
else {
ReadAddr *= 512; ReadAddr *= 512;
}
/* Set Block Size for Card */ /* Set Block Size for Card */
SDIO_CmdInitStructure.SDIO_Argument = (uint32_t) BlockSize; SDIO_CmdInitStructure.SDIO_Argument = (uint32_t) BlockSize;
@ -1281,12 +1277,10 @@ OPTIMIZE("O0") SD_Error SD_ReadMultiBlocks(uint8_t *readbuff, uint32_t ReadAddr,
SD_LowLevel_DMA_RxConfig((uint32_t *)readbuff, (NumberOfBlocks * BlockSize)); SD_LowLevel_DMA_RxConfig((uint32_t *)readbuff, (NumberOfBlocks * BlockSize));
SDIO_DMACmd(ENABLE); SDIO_DMACmd(ENABLE);
if (CardType == SDIO_HIGH_CAPACITY_SD_CARD) { if (CardType == SDIO_HIGH_CAPACITY_SD_CARD)
BlockSize = 512; BlockSize = 512;
} else
else {
ReadAddr *= 512; ReadAddr *= 512;
}
/*!< Set Block Size for Card */ /*!< Set Block Size for Card */
SDIO_CmdInitStructure.SDIO_Argument = (uint32_t) BlockSize; SDIO_CmdInitStructure.SDIO_Argument = (uint32_t) BlockSize;
@ -1417,12 +1411,10 @@ OPTIMIZE("O0") SD_Error SD_WriteBlock(uint8_t *writebuff, uint32_t WriteAddr, ui
SDIO_DMACmd(ENABLE); SDIO_DMACmd(ENABLE);
#endif #endif
if (CardType == SDIO_HIGH_CAPACITY_SD_CARD) { if (CardType == SDIO_HIGH_CAPACITY_SD_CARD)
BlockSize = 512; BlockSize = 512;
} else
else {
WriteAddr *= 512; WriteAddr *= 512;
}
/* Set Block Size for Card */ /* Set Block Size for Card */
SDIO_CmdInitStructure.SDIO_Argument = (uint32_t) BlockSize; SDIO_CmdInitStructure.SDIO_Argument = (uint32_t) BlockSize;

View file

@ -136,12 +136,7 @@ extern uint8_t telemetryProtocol;
#define IS_FRSKY_SPORT_PROTOCOL() (false) #define IS_FRSKY_SPORT_PROTOCOL() (false)
#endif #endif
#if defined(PCBFLAMENCO) #if defined(PCBTARANIS) || defined(PCBHORUS)
inline uint8_t modelTelemetryProtocol()
{
return g_model.telemetryProtocol;
}
#elif defined(CPUSTM32)
inline uint8_t modelTelemetryProtocol() inline uint8_t modelTelemetryProtocol()
{ {
#if defined(CROSSFIRE) #if defined(CROSSFIRE)

View file

@ -1074,8 +1074,13 @@
#define TR_SCRIPT "Script" #define TR_SCRIPT "Script"
#define TR_INPUTS "Inputs" #define TR_INPUTS "Inputs"
#define TR_OUTPUTS "Outputs" #define TR_OUTPUTS "Outputs"
#if defined(COLORLCD)
#define TR_EEBACKUP "EEPROM backup"
#define TR_FACTORYRESET "Factory reset"
#else
#define TR_EEBACKUP "\012[ENTER Long]: EEPROM backup" #define TR_EEBACKUP "\012[ENTER Long]: EEPROM backup"
#define TR_FACTORYRESET "\012[MENU Long]: Factory reset" #define TR_FACTORYRESET "\012[MENU Long]: Factory reset"
#endif
#define TR_CONFIRMRESET "Erase ALL models and settings?" #define TR_CONFIRMRESET "Erase ALL models and settings?"
#define TR_TO_MANY_LUA_SCRIPTS "Too many Lua scripts!" #define TR_TO_MANY_LUA_SCRIPTS "Too many Lua scripts!"