small demo code cleanup
This commit is contained in:
parent
bee9002fcc
commit
2df6eaf2fd
3 changed files with 6 additions and 5 deletions
|
@ -41,6 +41,7 @@ int main(void) {
|
||||||
gdispDrawBox(10, 10, width/2, height/2, Yellow);
|
gdispDrawBox(10, 10, width/2, height/2, Yellow);
|
||||||
gdispFillArea(width/2, height/2, width/2-10, height/2-10, Blue);
|
gdispFillArea(width/2, height/2, width/2-10, height/2-10, Blue);
|
||||||
gdispDrawLine(5, 30, width-50, height-40, Red);
|
gdispDrawLine(5, 30, width-50, height-40, Red);
|
||||||
|
|
||||||
for(i = 5, j = 0; i < width && j < height; i += 7, j += i/20)
|
for(i = 5, j = 0; i < width && j < height; i += 7, j += i/20)
|
||||||
gdispDrawPixel (i, j, White);
|
gdispDrawPixel (i, j, White);
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,6 @@ int main(void) {
|
||||||
gdispDrawArc(width-width/8, height/8, 30, 10, 70, Gray);
|
gdispDrawArc(width-width/8, height/8, 30, 10, 70, Gray);
|
||||||
gdispFillArc(width/8, height/8, 30, 10, 70, Gray);
|
gdispFillArc(width/8, height/8, 30, 10, 70, Gray);
|
||||||
|
|
||||||
|
|
||||||
while(TRUE) {
|
while(TRUE) {
|
||||||
chThdSleepMilliseconds(500);
|
chThdSleepMilliseconds(500);
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,6 +47,7 @@ int main(void) {
|
||||||
// Display large numbers on the right (measuring the string)
|
// Display large numbers on the right (measuring the string)
|
||||||
msg = "123456";
|
msg = "123456";
|
||||||
gdispDrawString(width-gdispGetStringWidth(msg, font4)-3, 3, msg, font4, Green);
|
gdispDrawString(width-gdispGetStringWidth(msg, font4)-3, 3, msg, font4, Green);
|
||||||
|
|
||||||
// Display the font name under it.
|
// Display the font name under it.
|
||||||
msg = gdispGetFontName(font4);
|
msg = gdispGetFontName(font4);
|
||||||
gdispDrawString(width-gdispGetStringWidth(msg, font1)-3, 20, msg, font1, Green);
|
gdispDrawString(width-gdispGetStringWidth(msg, font1)-3, 20, msg, font1, Green);
|
||||||
|
|
Loading…
Add table
Reference in a new issue