2 * betty.c - alternative firmware for the betty tv ;)
4 * author: hackbard@hackdaworld.org
15 const char announce[]="betty - live from flash at 0x80000000! ;)\r\n";
16 const char d1_txt[]="betty";
17 const char d2_txt[]="- alphablend -";
24 #define cc1100_init spi1_init(8,SPI_MASTER,8)
26 void display_string_page(u8 x,u8 p,u8 *s,u8 f,u8 o,u8 sp) {
33 display_font_page(x,p,(u8 *)default_font+(*(s)<<3),f);
39 void input_event(void) {
42 if(button_get_event(&button)) {
43 switch(button.key[0]) {
45 display_logo((u8 *)default_logo);
50 DISPLAY_SET_CONTRAST(contrast);
55 DISPLAY_SET_CONTRAST(contrast);
58 display_fill_screen(DISPLAY_FILL_W);
61 display_fill_screen(DISPLAY_FILL_LG);
64 display_fill_screen(DISPLAY_FILL_DG);
67 display_fill_screen(DISPLAY_FILL_B);
70 display_rectangle_page(4,2,60,5,
74 display_rectangle_page(40,5,50,5,
75 DISPLAY_FILL_LG,0x7f);
80 display_font_page(42,18,
81 (u8 *)default_font+(0x34<<3),
85 display_font_page(50,18,
86 (u8 *)default_font+(0x35<<3),
90 display_font_page(58,18,
91 (u8 *)default_font+(0x36<<3),
99 display_string_page(50,13,(u8 *)d1_txt,
103 display_string_page(10,8,(u8 *)d2_txt,
107 display_clear_screen();
127 /* memory mapping - dirty! */
128 if((void *)announce<(void *)FLASH_BANK0)
129 mmap_init(MEMTYPE_RAM);
131 mmap_init(MEMTYPE_EXT);
140 button.mode=BUTTON_INT;
141 button_init(&button);
142 button_set_retries(&button,0);
153 interrupt_ext_ir_config(INTERRUPT_EXT3,INTERRUPT_EXT_NOWAKE,
154 INTERRUPT_EXT_MODE_EDGE,
155 INTERRUPT_EXT_POLAR_LOW);
156 interrupt_enable(INTERRUPT_EINT3,INTERRUPT_MODE_VIRQ,0,input_event);
162 /* toggle the display back light */
166 uart0_send_string((char *)announce);