Skip to content

Commit

Permalink
Re-formatted code by indent
Browse files Browse the repository at this point in the history
  • Loading branch information
tisnik committed Sep 22, 2022
1 parent 8fdc04e commit d50ec86
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions rpi_framebuffer/rpi_fb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,20 @@ typedef struct fb_fix_screeninfo ModeInfo;
void printFramebufferInfo(int framebufferDevice)
{
FramebufferInfo framebufferInfo;
ModeInfo modeInfo;
ModeInfo modeInfo;

/* Pokud operace ioctl probehne v poradku, vrati se 0 */
if (ioctl(framebufferDevice, FBIOGET_VSCREENINFO, &framebufferInfo)) {
perror("Nelze precist informace o framebufferu");
return;
}
/* Nyni je datova struktura FramebufferInfo naplnena. */
printf("Realne rozliseni: %dx%d pixelu\n", framebufferInfo.xres, framebufferInfo.yres);
printf("Virtualni rozliseni: %dx%d pixelu\n", framebufferInfo.xres_virtual, framebufferInfo.yres_virtual);
printf("Bitu na pixel: %d bitu\n", framebufferInfo.bits_per_pixel);
printf("Realne rozliseni: %dx%d pixelu\n", framebufferInfo.xres,
framebufferInfo.yres);
printf("Virtualni rozliseni: %dx%d pixelu\n",
framebufferInfo.xres_virtual, framebufferInfo.yres_virtual);
printf("Bitu na pixel: %d bitu\n",
framebufferInfo.bits_per_pixel);

if (ioctl(framebufferDevice, FBIOGET_FSCREENINFO, &modeInfo)) {
perror("Nelze precist informace o rezimu");
Expand All @@ -44,7 +47,7 @@ int main(int argc, char **argv)
{
int framebufferDevice = 0;

/* Ze zarizeni potrebujeme pouze cist.*/
/* Ze zarizeni potrebujeme pouze cist. */
framebufferDevice = open("/dev/fb0", O_RDONLY);

/* Pokud otevreni probehlo uspesne, nacteme
Expand All @@ -54,10 +57,9 @@ int main(int argc, char **argv)
close(framebufferDevice);
return 0;
}
/* Otevreni se nezadarilo, vypiseme chybove hlaseni.*/
/* Otevreni se nezadarilo, vypiseme chybove hlaseni. */
else {
perror("Nelze otevrit ovladac /dev/fb0");
return 1;
}
}

0 comments on commit d50ec86

Please sign in to comment.