Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
  #include <nuttx/video/fb.h>
Code Block
  #ifdef CONFIG_VIDEO_FB
    /* Initialize and register the simulated framebuffer driver */
Code Block
    ret = fb_register(0, 0);
    if (ret < 0)
      {
        syslog(LOG_ERR, "ERROR: fb_register() failed: %d\n", ret);
      }
  #endif


The fb_register() function takes two parameters:

...

Code Block
  FAR void *fbmem;
Code Block
  fbmem = mmap(NULL, fblen, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_FILE, fd, 0);
  if (state.fbmem == MAP_FAILED)
    {
      /* Handle failure */
      ...
    }
Code Block
  printf("Mapped FB: %p\n", fbmem);

...