1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 21:05:35 +03:00

dropping useless max7456Lock boolean

This commit is contained in:
Kyle K 2019-06-29 01:00:41 +00:00
parent e824b9021b
commit d8dd9cacc3

View file

@ -212,7 +212,6 @@ static uint8_t displayMemoryModeReg = 0;
static uint8_t hosRegValue; // HOS (Horizontal offset register) value static uint8_t hosRegValue; // HOS (Horizontal offset register) value
static uint8_t vosRegValue; // VOS (Vertical offset register) value static uint8_t vosRegValue; // VOS (Vertical offset register) value
static bool max7456Lock = false;
static bool fontIsLoading = false; static bool fontIsLoading = false;
static uint8_t max7456DeviceType; static uint8_t max7456DeviceType;
@ -649,12 +648,10 @@ void max7456DrawScreen(void)
{ {
static uint16_t pos = 0; static uint16_t pos = 0;
if (!max7456Lock && !fontIsLoading) { if (!fontIsLoading) {
// (Re)Initialize MAX7456 at startup or stall is detected. // (Re)Initialize MAX7456 at startup or stall is detected.
max7456Lock = true;
max7456ReInitIfRequired(); max7456ReInitIfRequired();
int buff_len = 0; int buff_len = 0;
@ -684,7 +681,6 @@ void max7456DrawScreen(void)
__spiBusTransactionEnd(busdev); __spiBusTransactionEnd(busdev);
#endif // MAX7456_DMA_CHANNEL_TX #endif // MAX7456_DMA_CHANNEL_TX
} }
max7456Lock = false;
} }
} }
@ -732,17 +728,12 @@ static void max7456DrawScreenSlow(void)
// should not be used when armed // should not be used when armed
void max7456RefreshAll(void) void max7456RefreshAll(void)
{ {
if (!max7456Lock) {
#ifdef MAX7456_DMA_CHANNEL_TX #ifdef MAX7456_DMA_CHANNEL_TX
while (dmaTransactionInProgress); while (dmaTransactionInProgress);
#endif #endif
max7456Lock = true;
max7456ReInitIfRequired(); max7456ReInitIfRequired();
max7456DrawScreenSlow(); max7456DrawScreenSlow();
max7456Lock = false;
}
} }
void max7456WriteNvm(uint8_t char_address, const uint8_t *font_data) void max7456WriteNvm(uint8_t char_address, const uint8_t *font_data)
@ -750,8 +741,6 @@ void max7456WriteNvm(uint8_t char_address, const uint8_t *font_data)
#ifdef MAX7456_DMA_CHANNEL_TX #ifdef MAX7456_DMA_CHANNEL_TX
while (dmaTransactionInProgress); while (dmaTransactionInProgress);
#endif #endif
while (max7456Lock);
max7456Lock = true;
__spiBusTransactionBegin(busdev); __spiBusTransactionBegin(busdev);
// disable display // disable display
@ -779,8 +768,6 @@ void max7456WriteNvm(uint8_t char_address, const uint8_t *font_data)
while ((max7456Send(MAX7456ADD_STAT, 0x00) & STAT_NVR_BUSY) != 0x00); while ((max7456Send(MAX7456ADD_STAT, 0x00) & STAT_NVR_BUSY) != 0x00);
__spiBusTransactionEnd(busdev); __spiBusTransactionEnd(busdev);
max7456Lock = false;
} }
#ifdef MAX7456_NRST_PIN #ifdef MAX7456_NRST_PIN