diff --git a/slave/SPISlave.c b/slave/SPISlave.c index dc54cbb..1cb77b0 100644 --- a/slave/SPISlave.c +++ b/slave/SPISlave.c @@ -57,6 +57,7 @@ void AllClearCommand(char *symbols, int lenght){ Fill(255); update(); } + ClearPages(); } // command 2 diff --git a/slave/head_oled_i2c.h b/slave/head_oled_i2c.h index 5d6237e..f4cceab 100644 --- a/slave/head_oled_i2c.h +++ b/slave/head_oled_i2c.h @@ -71,6 +71,7 @@ void Fill(uint8_t fill); void update(); void DrawChar(uint8_t x, uint8_t y, uint8_t charIndex, uint8_t fill); +void ClearPages(); void AddSymbol(uint8_t symbol); void DelSymbol(); void SetPage(uint8_t p); diff --git a/slave/oled_i2c.c b/slave/oled_i2c.c index e0449f0..ae72776 100644 --- a/slave/oled_i2c.c +++ b/slave/oled_i2c.c @@ -292,6 +292,12 @@ void SetPage(uint8_t p){ if (p > 8) page = 8; } +void ClearPages(){ + for (uint8_t row = 0; row < 8; row++) { + amountByteInPage[row] = 0; + } +} + void AddSymbol(uint8_t symbol){ if (amountByteInPage[page] + 5 < 128){ DrawChar(amountByteInPage[page],page*8,symbol,1);