Skip to content

Commit

Permalink
Inline min, max in graphics library
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenjust committed Apr 3, 2016
1 parent cbc83a7 commit d3e8bb1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions software/video_system_graphics_library/graphics_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@
void *graphics_sdram_backbuffer;
static pixbuf_t sdram_backbuffer;

static int min(int a, int b)
static inline int min(int a, int b)
{
if (a < b) return a;
else return b;
}

static int max(int a, int b)
static inline int max(int a, int b)
{
if (a > b) return a;
else return b;
}

char graphics_init()
{
sdram_backbuffer.base_address = alt_uncached_malloc(FRAME_WIDTH * FRAME_HEIGHT);
sdram_backbuffer.base_address = (void *) alt_uncached_malloc(FRAME_WIDTH * FRAME_HEIGHT);
sdram_backbuffer.width = FRAME_WIDTH;
sdram_backbuffer.height = FRAME_HEIGHT;
if (sdram_backbuffer.base_address == 0) {
return -E_NOMEM;
} else {
IOWR_32DIRECT(VIDEO_FB_STREAMER_0_BASE, 0, sdram_backbuffer.base_address);
IOWR_32DIRECT(VIDEO_FB_STREAMER_0_BASE, 0, (int) sdram_backbuffer.base_address);
graphics_sdram_backbuffer = sdram_backbuffer.base_address; // FIXME: Remove this
return E_SUCCESS;
}
Expand Down

0 comments on commit d3e8bb1

Please sign in to comment.