add fb_ready()

This commit is contained in:
Josh Holtrop 2020-10-20 00:09:09 -04:00
parent 5bc844649b
commit a66df19edc
3 changed files with 12 additions and 0 deletions

View File

@ -1,4 +1,5 @@
#include "fb.h"
#include <stddef.h>
static uint32_t * fb;
static uint32_t fb_width;
@ -28,3 +29,8 @@ void fb_init(uint32_t * addr, uint32_t width, uint32_t height, uint32_t pitch)
}
}
}
bool fb_ready(void)
{
return fb != NULL;
}

View File

@ -2,7 +2,9 @@
#define FB_H
#include <stdint.h>
#include <stdbool.h>
void fb_init(uint32_t * addr, uint32_t width, uint32_t height, uint32_t pitch);
bool fb_ready(void);
#endif

View File

@ -5,4 +5,8 @@
void hos_main(uint32_t mbinfo_addr)
{
mbinfo_init(mbinfo_addr);
if (!fb_ready())
{
return;
}
}