avr-game
annotate avrgame.c @ 0:9db99968b55e
initial commit, screen test working
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Tue, 09 Sep 2014 04:40:47 +0300 |
parents | |
children | 872e425f0e7f |
rev | line source |
---|---|
nuclear@0 | 1 #include <avr/io.h> |
nuclear@0 | 2 #include <util/delay.h> |
nuclear@0 | 3 #include "dotmatrix.h" |
nuclear@0 | 4 |
nuclear@0 | 5 /* hardware setup |
nuclear@0 | 6 * - Port B[1,5]: lcd signals (see dotmatrix.h) |
nuclear@0 | 7 * - B1: clk |
nuclear@0 | 8 * - B2: Din |
nuclear@0 | 9 * - B3: DC |
nuclear@0 | 10 * - B4: CE |
nuclear@0 | 11 * - B5: RST |
nuclear@0 | 12 */ |
nuclear@0 | 13 |
nuclear@0 | 14 /*int lcd_stream_write(char c, FILE *fp);*/ |
nuclear@0 | 15 |
nuclear@0 | 16 /*FILE stream_lcd = FDEV_SETUP_STREAM(lcd_stream_write, NULL, _FDEV_SETUP_WRITE);*/ |
nuclear@0 | 17 |
nuclear@0 | 18 int main(void) |
nuclear@0 | 19 { |
nuclear@0 | 20 /* stdout = stderr = &stream_lcd; */ |
nuclear@0 | 21 |
nuclear@0 | 22 dm_init(); |
nuclear@0 | 23 dm_test(); |
nuclear@0 | 24 |
nuclear@0 | 25 for(;;) { |
nuclear@0 | 26 _delay_ms(800); |
nuclear@0 | 27 } |
nuclear@0 | 28 |
nuclear@0 | 29 return 0; |
nuclear@0 | 30 } |
nuclear@0 | 31 |
nuclear@0 | 32 #if 0 |
nuclear@0 | 33 int lcd_stream_write(char c, FILE *fp) |
nuclear@0 | 34 { |
nuclear@0 | 35 /* TODO terminal shit handling */ |
nuclear@0 | 36 return 0; |
nuclear@0 | 37 } |
nuclear@0 | 38 #endif |