Skip to content

Commit

Permalink
firmware/lm32/pattern: add vertical black/white line static pattern (…
Browse files Browse the repository at this point in the history
…no gui for now)
  • Loading branch information
enjoy-digital committed Jan 25, 2016
1 parent b9e390c commit 3e03c0f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
21 changes: 16 additions & 5 deletions firmware/lm32/pattern.c
Expand Up @@ -159,11 +159,22 @@ void pattern_fill_framebuffer(int h_active, int m_active)
flush_l2_cache();
color = -1;
volatile unsigned int *framebuffer = (unsigned int *)(MAIN_RAM_BASE + PATTERN_FRAMEBUFFER_BASE);
for(i=0; i<h_active*m_active*2/4; i++) {
if(i%(h_active/16) == 0)
color = inc_color(color);
if(color >= 0)
framebuffer[i] = color_bar[color];
if(pattern == COLOR_BAR_PATTERN) {
/* color bar pattern */
for(i=0; i<h_active*m_active*2/4; i++) {
if(i%(h_active/16) == 0)
color = inc_color(color);
if(color >= 0)
framebuffer[i] = color_bar[color];
}
} else {
/* vertical black white lines */
for(i=0; i<h_active*m_active*2/4; i++) {
if(i%(h_active/16) == 0)
color = inc_color(color);
if(color >= 0)
framebuffer[i] = 0x801080ff;
}
}
pattern_draw_text(1, 1, "HDMI2USB");
pattern_draw_text(1, 2, "TimVideo.us");
Expand Down
5 changes: 5 additions & 0 deletions firmware/lm32/pattern.h
Expand Up @@ -13,6 +13,11 @@

unsigned int pattern_framebuffer_base(void);

int pattern;

#define COLOR_BAR_PATTERN 0
#define VERTICAL_BLACK_WHITE_LINES_PATTERN 1

void pattern_fill_framebuffer(int h_active, int m_active);
void pattern_service(void);

Expand Down
1 change: 1 addition & 0 deletions firmware/lm32/processor.c
Expand Up @@ -387,6 +387,7 @@ void processor_init(void)
encoder_enable(0);
encoder_target_fps = 30;
#endif
pattern = COLOR_BAR_PATTERN;
}

void processor_start(int mode)
Expand Down

0 comments on commit 3e03c0f

Please sign in to comment.