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

Fixes#2750__Mega2560_ST7920_mixer_freq_too_slow

This commit is contained in:
tmertelj 2015-09-30 21:28:30 +02:00
parent 8a6ba0eb8e
commit 11753450ae
3 changed files with 25 additions and 26 deletions

View file

@ -265,6 +265,9 @@ void lcdRefresh();
#if defined(LCD_ST7920) #if defined(LCD_ST7920)
uint8_t lcdRefresh_ST7920(uint8_t full); uint8_t lcdRefresh_ST7920(uint8_t full);
#define IS_LCD_REFRESH_ALLOWED() (0==lcdstate)
#else
#define IS_LCD_REFRESH_ALLOWED() (1)
#endif #endif
#if defined(BOOT) #if defined(BOOT)

View file

@ -45,7 +45,7 @@ void perMain()
doMixerCalculations(); doMixerCalculations();
#endif #endif
#if defined(LCD_ST7920) #if defined(LCD_ST7920)
uint8_t lcdstate=0; uint8_t lcdstate=0;
#endif #endif
uint16_t t0 = getTmr16KHz(); uint16_t t0 = getTmr16KHz();
int16_t delta = (nextMixerEndTime - lastMixerDuration) - t0; int16_t delta = (nextMixerEndTime - lastMixerDuration) - t0;
@ -132,35 +132,31 @@ void perMain()
const char *warn = s_warning; const char *warn = s_warning;
uint8_t menu = s_menu_count; uint8_t menu = s_menu_count;
#if defined(LCD_ST7920) if(IS_LCD_REFRESH_ALLOWED()){//No need to redraw until lcdRefresh_ST7920(0) below completely refreshes the display.
if(0==lcdstate){//No need to redraw until lcdRefresh_ST7920(0) below completely refreshes the display. lcd_clear();
#endif if (menuEvent) {
lcd_clear(); m_posVert = menuEvent == EVT_ENTRY_UP ? g_menuPos[g_menuStackPtr] : 0;
if (menuEvent) { m_posHorz = 0;
m_posVert = menuEvent == EVT_ENTRY_UP ? g_menuPos[g_menuStackPtr] : 0; evt = menuEvent;
m_posHorz = 0; menuEvent = 0;
evt = menuEvent; AUDIO_MENUS();
menuEvent = 0; }
AUDIO_MENUS(); g_menuStack[g_menuStackPtr]((warn || menu) ? 0 : evt);
}
g_menuStack[g_menuStackPtr]((warn || menu) ? 0 : evt);
if (warn) DISPLAY_WARNING(evt); if (warn) DISPLAY_WARNING(evt);
#if defined(NAVIGATION_MENUS) #if defined(NAVIGATION_MENUS)
if (menu) { if (menu) {
const char * result = displayMenu(evt); const char * result = displayMenu(evt);
if (result) { if (result) {
menuHandler(result); menuHandler(result);
putEvent(EVT_MENU_UP); putEvent(EVT_MENU_UP);
} }
} }
#endif #endif
drawStatusLine();
drawStatusLine();
#if defined(LCD_ST7920)
} }
#if defined(LCD_ST7920)
lcdstate=lcdRefresh_ST7920(0); lcdstate=lcdRefresh_ST7920(0);
#else #else
lcdRefresh(); lcdRefresh();

View file

@ -1098,7 +1098,7 @@ void evalMixes(uint8_t tick10ms)
} }
} }
#if (defined(PCBMEGA2560) || defined(PCBGRUVIN9X)) && defined(DEBUG) && !defined(VOICE) #if (defined(CPU2560) && defined(DEBUG) && !defined(VOICE))
PORTH &= ~0x40; // PORTH:6 HIGH->LOW signals end of mixer interrupt PORTH &= ~0x40; // PORTH:6 HIGH->LOW signals end of mixer interrupt
#endif #endif
} }