]> git.defcon.no Git - avrfbosd/commitdiff
Adding some test-files
authorJon Langseth <jon.langseth@lilug.no>
Thu, 27 Jun 2013 19:33:49 +0000 (21:33 +0200)
committerJon Langseth <jon.langseth@lilug.no>
Thu, 27 Jun 2013 19:33:49 +0000 (21:33 +0200)
fbosd.c
font.h [new file with mode: 0644]
testimage.h [new file with mode: 0644]

diff --git a/fbosd.c b/fbosd.c
index c30ee9b5aa3606601ef10f6c07168f890560ca64..e4524aaf52bd339ea1f9cb2894cc2b93bbfa5407 100644 (file)
--- a/fbosd.c
+++ b/fbosd.c
@@ -2,10 +2,12 @@
 #include <avr/interrupt.h>
 #include <util/delay.h>
 #include <stdlib.h>
+#include <avr/pgmspace.h>
 
 #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 (file)
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 (file)
index 0000000..00dc78b
--- /dev/null
@@ -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..
+};