diff --git a/src/main_views.cpp b/src/main_views.cpp index 827c82a8f..77faa5b73 100644 --- a/src/main_views.cpp +++ b/src/main_views.cpp @@ -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); diff --git a/src/open9x.cpp b/src/open9x.cpp index 289f92d95..0e02a6506 100644 --- a/src/open9x.cpp +++ b/src/open9x.cpp @@ -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; diff --git a/src/open9x.h b/src/open9x.h index 0f31b9008..8e788ae34 100644 --- a/src/open9x.h +++ b/src/open9x.h @@ -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 diff --git a/src/pulses_arm.cpp b/src/pulses_arm.cpp index 5d3326b2b..9661037bf 100644 --- a/src/pulses_arm.cpp +++ b/src/pulses_arm.cpp @@ -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) { diff --git a/src/pulses_avr.cpp b/src/pulses_avr.cpp index ea853bcef..e66be1f73 100644 --- a/src/pulses_avr.cpp +++ b/src/pulses_avr.cpp @@ -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;