mirror of
https://github.com/opentx/opentx.git
synced 2025-07-24 16:55:20 +03:00
Issue #826 fixed
This commit is contained in:
parent
f7de9e510a
commit
57e2428c29
2 changed files with 25 additions and 19 deletions
|
@ -51,12 +51,14 @@
|
||||||
#define TRACE_WARNING(...) do { printf("-W- " __VA_ARGS__); fflush(stdout); } while(0)
|
#define TRACE_WARNING(...) do { printf("-W- " __VA_ARGS__); fflush(stdout); } while(0)
|
||||||
#define TRACE_WARNING_WP(...) do { printf(__VA_ARGS__); fflush(stdout); } while(0)
|
#define TRACE_WARNING_WP(...) do { printf(__VA_ARGS__); fflush(stdout); } while(0)
|
||||||
#define TRACE_ERROR(...) do { printf("-E- " __VA_ARGS__); fflush(stdout); } while(0)
|
#define TRACE_ERROR(...) do { printf("-E- " __VA_ARGS__); fflush(stdout); } while(0)
|
||||||
inline void dump(unsigned char *data, unsigned int size)
|
inline void dump(void * data, unsigned int size)
|
||||||
{
|
{
|
||||||
|
unsigned char *uchar_data = (unsigned char *)data;
|
||||||
|
|
||||||
printf("DUMP %d bytes ...\n\r", size);
|
printf("DUMP %d bytes ...\n\r", size);
|
||||||
unsigned int i = 0, j=0;
|
unsigned int i = 0, j=0;
|
||||||
while (i*32+j < size) {
|
while (i*32+j < size) {
|
||||||
printf("%.2X ", data[i*32+j]);
|
printf("%.2X ", uchar_data[i*32+j]);
|
||||||
j++;
|
j++;
|
||||||
if (j==32) {
|
if (j==32) {
|
||||||
i++; j=0;
|
i++; j=0;
|
||||||
|
|
|
@ -507,8 +507,10 @@ void ConvertModel_215_to_216(ModelData &model)
|
||||||
g_model.expoData[i].weight = oldModel.expoData[i].weight;
|
g_model.expoData[i].weight = oldModel.expoData[i].weight;
|
||||||
memcpy(&g_model.expoData[i].name, &oldModel.expoData[i].name, LEN_EXPOMIX_NAME);
|
memcpy(&g_model.expoData[i].name, &oldModel.expoData[i].name, LEN_EXPOMIX_NAME);
|
||||||
if (oldModel.expoData[i].curveMode==0/*expo*/) {
|
if (oldModel.expoData[i].curveMode==0/*expo*/) {
|
||||||
g_model.expoData[i].curve.type = CURVE_REF_EXPO;
|
if (oldModel.expoData[i].curveParam) {
|
||||||
g_model.expoData[i].curve.value = oldModel.expoData[i].curveParam;
|
g_model.expoData[i].curve.type = CURVE_REF_EXPO;
|
||||||
|
g_model.expoData[i].curve.value = oldModel.expoData[i].curveParam;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (oldModel.expoData[i].curveParam <= 6) {
|
else if (oldModel.expoData[i].curveParam <= 6) {
|
||||||
g_model.expoData[i].curve.type = CURVE_REF_FUNC;
|
g_model.expoData[i].curve.type = CURVE_REF_FUNC;
|
||||||
|
@ -710,24 +712,26 @@ void ConvertModel_215_to_216(ModelData &model)
|
||||||
g_model.swashR.collectiveSource = ConvertSource_215_to_216(g_model.swashR.collectiveSource);
|
g_model.swashR.collectiveSource = ConvertSource_215_to_216(g_model.swashR.collectiveSource);
|
||||||
|
|
||||||
for (uint8_t i=0; i<9; i++) {
|
for (uint8_t i=0; i<9; i++) {
|
||||||
memcpy(&g_model.phaseData[i], &oldModel.phaseData[i], sizeof(oldModel.phaseData[i])); // the last 4 gvars will remain blank
|
if (oldModel.phaseData[i].swtch) {
|
||||||
g_model.phaseData[i].swtch = ConvertSwitch_215_to_216(oldModel.phaseData[i].swtch);
|
memcpy(&g_model.phaseData[i], &oldModel.phaseData[i], sizeof(oldModel.phaseData[i])); // the last 4 gvars will remain blank
|
||||||
|
g_model.phaseData[i].swtch = ConvertSwitch_215_to_216(oldModel.phaseData[i].swtch);
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
for (uint8_t t=0; t<4; t++) {
|
for (uint8_t t=0; t<4; t++) {
|
||||||
int trim = oldModel.phaseData[i].trim[t];
|
int trim = oldModel.phaseData[i].trim[t];
|
||||||
if (trim > 500) {
|
if (trim > 500) {
|
||||||
trim -= 501;
|
trim -= 501;
|
||||||
if (trim >= i)
|
if (trim >= i)
|
||||||
trim += 1;
|
trim += 1;
|
||||||
g_model.phaseData[i].trim[t].mode = 2*trim;
|
g_model.phaseData[i].trim[t].mode = 2*trim;
|
||||||
g_model.phaseData[i].trim[t].value = 0;
|
g_model.phaseData[i].trim[t].value = 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
g_model.phaseData[i].trim[t].mode = 2*i;
|
||||||
|
g_model.phaseData[i].trim[t].value = trim;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
g_model.phaseData[i].trim[t].mode = 2*i;
|
|
||||||
g_model.phaseData[i].trim[t].value = trim;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
g_model.thrTraceSrc = oldModel.thrTraceSrc;
|
g_model.thrTraceSrc = oldModel.thrTraceSrc;
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue