diff --git a/src/main/drivers/max7456.c b/src/main/drivers/max7456.c index ca0c8d5890..63c3e6f71e 100755 --- a/src/main/drivers/max7456.c +++ b/src/main/drivers/max7456.c @@ -205,7 +205,7 @@ void max7456ReInit(void) uint8_t maxScreenRows; uint8_t srdata = 0; uint16_t x; - static uint8_t firstInit = 1; + static bool firstInit = true; //do not init MAX before camera power up correctly if (millis() < 1500) @@ -249,7 +249,7 @@ void max7456ReInit(void) if (firstInit) { max7456RefreshAll(); - firstInit = 0; + firstInit = false; } } @@ -327,10 +327,8 @@ void max7456DrawScreen(void) //------------ end of (re)init------------------------------------- - for (k=0; k< MAX_CHARS2UPDATE; k++) - { - if (screenBuffer[pos] != shadowBuffer[pos]) - { + for (k=0; k< MAX_CHARS2UPDATE; k++) { + if (screenBuffer[pos] != shadowBuffer[pos]) { spiBuff[buff_len++] = MAX7456ADD_DMAH; spiBuff[buff_len++] = pos >> 8; spiBuff[buff_len++] = MAX7456ADD_DMAL; diff --git a/src/main/drivers/max7456.h b/src/main/drivers/max7456.h index 1a6276357a..6663b12934 100755 --- a/src/main/drivers/max7456.h +++ b/src/main/drivers/max7456.h @@ -35,15 +35,15 @@ #define VM1_REG 0x01 // video mode register 0 bits -#define VIDEO_BUFFER_DISABLE 0x01 -#define MAX7456_RESET 0x02 -#define VERTICAL_SYNC_NEXT_VSYNC 0x04 -#define OSD_ENABLE 0x08 -#define SYNC_MODE_AUTO 0x00 -#define SYNC_MODE_INTERNAL 0x30 -#define SYNC_MODE_EXTERNAL 0x20 -#define VIDEO_MODE_PAL 0x40 -#define VIDEO_MODE_NTSC 0x00 +#define VIDEO_BUFFER_DISABLE 0x01 +#define MAX7456_RESET 0x02 +#define VERTICAL_SYNC_NEXT_VSYNC 0x04 +#define OSD_ENABLE 0x08 +#define SYNC_MODE_AUTO 0x00 +#define SYNC_MODE_INTERNAL 0x30 +#define SYNC_MODE_EXTERNAL 0x20 +#define VIDEO_MODE_PAL 0x40 +#define VIDEO_MODE_NTSC 0x00 // video mode register 1 bits diff --git a/src/main/io/osd.c b/src/main/io/osd.c index 3c24f2b8f3..1fdbb2507d 100755 --- a/src/main/io/osd.c +++ b/src/main/io/osd.c @@ -1143,7 +1143,7 @@ void updateOsd(void) static uint32_t counter; #ifdef MAX7456_DMA_CHANNEL_TX // don't touch buffers if DMA transaction is in progress - if (max7456_dma_in_progres()) + if (max7456DmaInProgres()) return; #endif // MAX7456_DMA_CHANNEL_TX