Fix display (needs new zephyr)

This commit is contained in:
Korneliusz Osmenda
2022-08-22 21:58:54 +02:00
parent 3268072965
commit cdb81935ea
5 changed files with 78 additions and 31 deletions
+10 -8
View File
@@ -30,9 +30,12 @@ int Display::Init()
void Display::blank_off()
{
k_mutex_lock(&mut, K_FOREVER);
display_blanking_off(dev);
k_mutex_unlock(&mut);
}
void Display::blank_on()
{
display_blanking_on(dev);
}
void Display::print_chr(int x, int y, char c)
@@ -52,16 +55,15 @@ void Display::print_chr(int x, int y, char c)
.height=16,
.pitch=8
};
k_mutex_lock(&mut, K_FOREVER);
display_write(dev,x,y,&desc,my_font_[idx]);
k_mutex_unlock(&mut);
}
void Display::print_str(int x, int y, const char* str)
{
while(*str)
{
print_chr(x,y,*str++);
x+=8;
}
}