Example #1
0
void testimage_init() {
	uint8_t topcolors[]={
		255,255,255,
		255,255,0,
		0,255,255,
		0,255,0,
		255,0,255,
		255,0,0,
		0,0,255
	};
	uint8_t barcolors[]={
		0,0,255,
		0,0,0,
		255,0,255,
		0,0,0,
		0,255,255,
		0,0,0,
		255,255,255
	};
	unsigned int x,y;
	for (x=0; x<MATRIX_WIDTH; x++) {
		for (y=0; y<MATRIX_HEIGHT; y++) {
			unsigned int seg = (y * 13)/MATRIX_HEIGHT;
			if (seg < 8) {
				unsigned int c=(x * ((sizeof(topcolors)/sizeof(topcolors[0]))/3))/MATRIX_WIDTH;
				testimage_setb(x,y,&topcolors[c*3]);
			} else if (seg == 8) {
				unsigned int c=(x * ((sizeof(barcolors)/sizeof(barcolors[0]))/3))/MATRIX_WIDTH;
				testimage_setb(x,y,&barcolors[c*3]);
			} else {
				unsigned int v = (x * 255)/MATRIX_WIDTH;
				unsigned int c = seg-9;
				testimage_set(x,y,(c == 0 || c == 3)?v:0,(c == 1 || c == 3)?v:0,(c == 2 || c == 3)?v:0);
			}
		}
	}
	framebuffer_swap();
}
Example #2
0
void
framebuffer_init (void)
{
  framebuffer_swap();
}