From 2623aa00ed7c0bf268992fe9ccd2c5efa4b66882 Mon Sep 17 00:00:00 2001 From: bsongis Date: Thu, 5 Apr 2012 07:12:03 +0000 Subject: [PATCH] Make companion9x compile with recent changes --- src/board_gruvin9x.cpp | 2 +- src/eeprom_arm.cpp | 6 ++++++ src/ersky9x/sound.cpp | 2 +- src/myeeprom.h | 6 +++--- src/open9x.cpp | 8 ++++---- src/simpgmspace.cpp | 1 + 6 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/board_gruvin9x.cpp b/src/board_gruvin9x.cpp index fe21c3f72..5b5305619 100644 --- a/src/board_gruvin9x.cpp +++ b/src/board_gruvin9x.cpp @@ -75,7 +75,7 @@ inline void board_init() uint8_t check_soft_power() { -#ifndef REV0 +#if !defined(SIMU) && !defined(REV0) if ((PING & 0b00000010) && (~PINL & 0b01000000)) return e_power_off; #endif diff --git a/src/eeprom_arm.cpp b/src/eeprom_arm.cpp index d2c9c3010..fa3a3acc1 100644 --- a/src/eeprom_arm.cpp +++ b/src/eeprom_arm.cpp @@ -479,6 +479,12 @@ bool ee32LoadGeneral() return true; } } +#ifdef SIMU + else { + printf("EEPROM version %d instead of %d\n", g_eeGeneral.myVers, EEPROM_VER); + fflush(stdout); + } +#endif return false; } diff --git a/src/ersky9x/sound.cpp b/src/ersky9x/sound.cpp index 1c8c285d3..ab214de72 100644 --- a/src/ersky9x/sound.cpp +++ b/src/ersky9x/sound.cpp @@ -32,7 +32,7 @@ * ****************************************************************************/ -#include "open9x.h" +#include "../open9x.h" void start_sound( void ) ; void buzzer_on( void ) ; diff --git a/src/myeeprom.h b/src/myeeprom.h index 0f8b1c58c..02a86887e 100644 --- a/src/myeeprom.h +++ b/src/myeeprom.h @@ -375,8 +375,10 @@ PACK(typedef struct t_SwashRingData { // Swash Ring data #if defined(PCBV4) #define NUM_ROTARY_ENCODERS 2 #define ROTARY_ENCODER_MAX 1024 +#define ROTARY_ENCODER_ARRAY int16_t rotaryEncoders[NUM_ROTARY_ENCODERS]; #else #define NUM_ROTARY_ENCODERS 0 +#define ROTARY_ENCODER_ARRAY #endif @@ -388,9 +390,7 @@ PACK(typedef struct t_PhaseData { char name[6]; uint8_t fadeIn:4; uint8_t fadeOut:4; -#if defined(PCBV4) - int16_t rotaryEncoders[NUM_ROTARY_ENCODERS]; -#endif + ROTARY_ENCODER_ARRAY }) PhaseData; #define MAX_MODELS 16 diff --git a/src/open9x.cpp b/src/open9x.cpp index 7692f68ac..a49905bdc 100644 --- a/src/open9x.cpp +++ b/src/open9x.cpp @@ -1221,9 +1221,9 @@ enum PerOutMode { uint8_t s_perout_mode = e_perout_mode_normal; -uint8_t evalSticks(uint8_t phase) +BeepANACenter evalSticks(uint8_t phase) { - uint8_t anaCenter = 0; + BeepANACenter anaCenter = 0; #ifdef HELI uint16_t d = 0; @@ -1265,7 +1265,7 @@ uint8_t evalSticks(uint8_t phase) calibratedStick[ch] = v; //for show in expo uint8_t tmp = (uint16_t)abs(v) / 16; - if (tmp <= 1) anaCenter |= (tmp==0 ? 1<