Added double buffering simulation to "simu"
This commit is contained in:
@@ -410,40 +410,12 @@ void stopAudioThread()
|
||||
}
|
||||
#endif // #if defined(SIMU_AUDIO)
|
||||
|
||||
bool simuLcdRefresh = true;
|
||||
pixel_t simuLcdBuf[DISPLAY_BUFFER_SIZE];
|
||||
|
||||
#if !defined(COLORLCD)
|
||||
void lcdSetRefVolt(uint8_t val)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
void lcdOff()
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
void lcdRefresh()
|
||||
{
|
||||
static bool lightEnabled = (bool)isBacklightEnabled();
|
||||
|
||||
if (bool(isBacklightEnabled()) != lightEnabled || memcmp(simuLcdBuf, displayBuf, DISPLAY_BUFFER_SIZE * sizeof(pixel_t))) {
|
||||
#if defined(LCD_VERTICAL_INVERT)
|
||||
auto src = (pixel_t*)displayBuf + DISPLAY_BUFFER_SIZE - 1;
|
||||
auto dst = simuLcdBuf;
|
||||
auto end = dst + DISPLAY_BUFFER_SIZE;
|
||||
|
||||
while (dst != end) { *(dst++) = *(src--); }
|
||||
#else
|
||||
memcpy(simuLcdBuf, displayBuf, DISPLAY_BUFFER_SIZE * sizeof(pixel_t));
|
||||
#endif
|
||||
lightEnabled = (bool)isBacklightEnabled();
|
||||
simuLcdRefresh = true;
|
||||
}
|
||||
}
|
||||
|
||||
void telemetryPortInit(uint8_t baudrate)
|
||||
{
|
||||
}
|
||||
@@ -509,23 +481,6 @@ void boardInit()
|
||||
{
|
||||
}
|
||||
|
||||
pixel_t simuLcdBackupBuf[DISPLAY_BUFFER_SIZE];
|
||||
void lcdStoreBackupBuffer()
|
||||
{
|
||||
memcpy(simuLcdBackupBuf, displayBuf, sizeof(simuLcdBackupBuf));
|
||||
}
|
||||
|
||||
int lcdRestoreBackupBuffer()
|
||||
{
|
||||
memcpy(displayBuf, simuLcdBackupBuf, sizeof(displayBuf));
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint16_t* lcdGetBackupBuffer()
|
||||
{
|
||||
return (uint16_t*)simuLcdBackupBuf;
|
||||
}
|
||||
|
||||
uint32_t pwrCheck()
|
||||
{
|
||||
// TODO: ability to simulate shutdown warning for a "soft" simulator restart
|
||||
|
||||
Reference in New Issue
Block a user