From: Jon Langseth Date: Thu, 27 Jun 2013 19:33:49 +0000 (+0200) Subject: Adding some test-files X-Git-Url: https://git.defcon.no/?a=commitdiff_plain;h=b7d939564dc83d05de1dc7baa7c28ca0abee5af6;p=avrfbosd Adding some test-files --- diff --git a/fbosd.c b/fbosd.c index c30ee9b..e4524aa 100644 --- a/fbosd.c +++ b/fbosd.c @@ -2,10 +2,12 @@ #include #include #include +#include #include "video_properties.h" #include "render.h" #include "draw.h" +#include "font.h" void (*line_handler)( void ); @@ -137,6 +139,7 @@ int main(void) // Enable interrupts globally. sei(); +/* // Do some static drawing :P set_pixel(28, 8, 1); set_pixel(92, 82, 1); @@ -188,6 +191,28 @@ int main(void) } Delay_ms(250); } +*/ + + for (int q = 0; q < font_height; q++ ) + { + //for (int r = 0; r < font_width; r++ ) + //{ + uint8_t t = pgm_read_byte(&(font[0][q])); + screen_buffer[q*hres_bytes+3+hres_bytes] |= t; + + t = pgm_read_byte(&(font[1][q])); + screen_buffer[q*hres_bytes+5+hres_bytes] |= t; + + t = pgm_read_byte(&(font[2][q])); + screen_buffer[q*hres_bytes+6+hres_bytes] |= t; + + //} + } + + for (;;) + { + + } } diff --git a/font.h b/font.h new file mode 100644 index 0000000..215fb7d --- /dev/null +++ b/font.h @@ -0,0 +1,130 @@ +const uint8_t font_width = 8; +const uint8_t font_height = 8; + +const uint8_t font[3][64] PROGMEM = { +// Space +// ! +// " +// # +// $ +// % +// & +// ' +// ( +// ) +// * +// + +// , +// - +// . +// / +// 0 +// 1 +// 2 +// 3 +// 4 +// 5 +// 6 +// 7 +// 8 +// 9 +// : +// ; +// < +// = +// > +// ? +// @ +// A + { + 0b00010000, + 0b00101000, + 0b01000100, + 0b10000010, + 0b11111110, + 0b10000010, + 0b10000010, + 0b10000010 + }, +// B + { + 0b11111000, + 0b10000100, + 0b10000100, + 0b11111000, + 0b10000100, + 0b10000100, + 0b10000100, + 0b11111000 + }, +// C + { + 0b01111100, + 0b10000010, + 0b10000000, + 0b10000000, + 0b10000000, + 0b10000000, + 0b10000010, + 0b01111100 + }, +// D +// E +// F +// G +// H +// I +// J +// K +// L +// M +// N +// O +// P +// Q +// R +// S +// T +// U +// V +// W +// X +// Y +// Z +// [ +// \ +// ] +// ^ +// _ +// ` +// a +// b +// c +// d +// e +// f +// g +// h +// i +// j +// k +// l +// m +// n +// o +// p +// q +// r +// s +// t +// u +// v +// w +// x +// y +// z +// { +// | +// } +// ~ +}; \ No newline at end of file diff --git a/testimage.h b/testimage.h new file mode 100644 index 0000000..00dc78b --- /dev/null +++ b/testimage.h @@ -0,0 +1,11 @@ +image_widtdh = 23; // pixels +image_height = 9; // rows + +uint8_t image[] = { + 0b00001111, 0b00000001, 0b11100000, 0b00100001, 0b00000100, 0b00100000 + 0b10011001, 0b00010011, 0b00100010, 0b01001001, 0b01001001, 0b00101001 + 0b00001001, 0b00100001, 0b00101001, 0b00100101, 0b00100100, 0b10001001 + 0b10010001, 0b00110010, 0b00001000, 0b01000001, 0b00001000, 0b00001111 + 0b00000001, + 0b11100000 // Note, last byte padded to fill one byte by adding a 0 at the end.. +};