Add definition of spi_buffer size

Add check cell and spi_buffer size
This commit is contained in:
DiSlord 2020-02-23 17:13:52 +03:00
parent c92987c52e
commit 5ee23be06f
3 changed files with 9 additions and 2 deletions

4
plot.c
View file

@ -16,6 +16,10 @@ int16_t area_height = AREA_HEIGHT_NORMAL;
// Depends from spi_buffer size, CELLWIDTH*CELLHEIGHT <= sizeof(spi_buffer)
#define CELLWIDTH (64)
#define CELLHEIGHT (32)
// Check buffer size
#if CELLWIDTH*CELLHEIGHT > SPI_BUFFER_SIZE
#error "Too small spi_buffer size SPI_BUFFER_SIZE < CELLWIDTH*CELLHEIGH"
#endif
// indicate dirty cells (not redraw if cell data not changed)
#define MAX_MARKMAP_X ((320+CELLWIDTH-1)/CELLWIDTH)