47 struct fb_fix_screeninfo fix_info;
54 info->fbfd = open(
"/dev/fb1", O_RDWR);
55 if (
info->fbfd == -1) {
56 perror(
"Error (call to 'open')");
61 if (ioctl(
info->fbfd, FBIOGET_FSCREENINFO, &fix_info) == -1) {
62 perror(
"Error (call to 'ioctl')");
68 if (strcmp(fix_info.id,
"RPi-Sense FB") != 0) {
69 printf(
"Error: RPi-Sense FB not found\n");
75 info->map = mmap(NULL,
FILESIZE, PROT_READ | PROT_WRITE, MAP_SHARED,
info->fbfd, 0);
76 if (
info->map == MAP_FAILED) {
78 perror(
"Error mmapping the file");