Fix simu compilation errors

Issue 82 first try with #define FRANCK in main_views.cpp
This commit is contained in:
bsongis
2012-08-20 20:44:43 +00:00
parent 511f5b8338
commit ae5d7c8952
5 changed files with 22 additions and 11 deletions
+9 -2
View File
@@ -266,11 +266,13 @@ void menuMainView(uint8_t event)
for (uint8_t i=0; i<8; i++) {
uint8_t x0,y0;
#if defined(PCBARM)
int16_t val = g_chans512[8*(g_eeGeneral.view / ALTERNATE_VIEW) + i];
uint8_t chan = 8*(g_eeGeneral.view / ALTERNATE_VIEW) + i;
#else
int16_t val = g_chans512[(g_eeGeneral.view & ALTERNATE_VIEW) ? 8+i : i];
uint8_t chan = (g_eeGeneral.view & ALTERNATE_VIEW) ? 8+i : i;
#endif
int16_t val = g_chans512[chan];
switch(view_base)
{
case e_outputValues:
@@ -290,7 +292,12 @@ void menuMainView(uint8_t event)
x0 = i<4 ? 128/4+2 : 128*3/4-2;
y0 = 38+(i%4)*5;
#ifdef FRANCK
uint16_t lim = calc100toRESX(val > 0 ? 100+g_model.limitData[chan].max : +100-g_model.limitData[chan].min);
int8_t len = (abs(val) * WBAR2 + lim/2) / lim;
#else
int8_t len = (abs(val) * WBAR2 + 512) / 1024;
#endif
if(len>WBAR2) len = WBAR2; // prevent bars from going over the end - comment for debugging
lcd_hlineStip(x0-WBAR2, y0, WBAR2*2+1, DOTTED);
lcd_vline(x0,y0-2,5);
+7
View File
@@ -95,6 +95,13 @@ uint8_t g_timeMainLast;
audioQueue audio;
#endif
#if defined(DSM2)
// TODO port to ARM Bryan's code
bool s_bind_mode = false;
bool s_rangecheck_mode = false;
uint8_t s_bind_allowed = 255;
#endif
uint8_t heartbeat;
uint8_t stickMode;
+6
View File
@@ -99,6 +99,12 @@ extern void board_init();
#include "pulses_avr.h"
#endif
#if defined(DSM2)
extern bool s_bind_mode;
extern bool s_rangecheck_mode;
extern uint8_t s_bind_allowed;
#endif
#if defined(DSM2)
#define IS_DSM2_PROTOCOL(protocol) (protocol==PROTO_DSM2)
#else
-5
View File
@@ -351,11 +351,6 @@ void sendByteDsm2(uint8_t b) //max 10changes 0 10 10 10 10 1
// This is the data stream to send, prepare after 19.5 mS
// Send after 22.5 mS
// TODO port to ARM Bryan's code
bool s_bind_mode = false; // Issue 98
bool s_rangecheck_mode = false;
uint8_t s_bind_allowed = 255; // Issue 98
//static uint8_t *Dsm2_pulsePtr = pulses2MHz.pbyte ;
void setupPulsesDsm2(uint8_t chns)
{
-4
View File
@@ -418,10 +418,6 @@ normal:
*/
bool s_bind_mode = false; // Issue 98
bool s_rangecheck_mode = false;
uint8_t s_bind_allowed = 255; // Issue 98
FORCEINLINE void setupPulsesDsm2()
{
uint16_t *ptr = (uint16_t *)pulses2MHz;