Добавлена очистка строчек при очистке дисплея

This commit is contained in:
MartMazik 2023-06-03 17:17:07 +03:00
parent 3888af0897
commit 67cfe20124
3 changed files with 8 additions and 0 deletions

View File

@ -57,6 +57,7 @@ void AllClearCommand(char *symbols, int lenght){
Fill(255); Fill(255);
update(); update();
} }
ClearPages();
} }
// command 2 // command 2

View File

@ -71,6 +71,7 @@ void Fill(uint8_t fill);
void update(); void update();
void DrawChar(uint8_t x, uint8_t y, uint8_t charIndex, uint8_t fill); void DrawChar(uint8_t x, uint8_t y, uint8_t charIndex, uint8_t fill);
void ClearPages();
void AddSymbol(uint8_t symbol); void AddSymbol(uint8_t symbol);
void DelSymbol(); void DelSymbol();
void SetPage(uint8_t p); void SetPage(uint8_t p);

View File

@ -292,6 +292,12 @@ void SetPage(uint8_t p){
if (p > 8) page = 8; if (p > 8) page = 8;
} }
void ClearPages(){
for (uint8_t row = 0; row < 8; row++) {
amountByteInPage[row] = 0;
}
}
void AddSymbol(uint8_t symbol){ void AddSymbol(uint8_t symbol){
if (amountByteInPage[page] + 5 < 128){ if (amountByteInPage[page] + 5 < 128){
DrawChar(amountByteInPage[page],page*8,symbol,1); DrawChar(amountByteInPage[page],page*8,symbol,1);