#define cc1100_init spi1_init(8,SPI_MASTER,8)
+void display_string_page(u8 x,u8 p,u8 *s,u8 f,u8 o,u8 sp) {
+
+ while(*(s)) {
+ if(x==DISPLAY_DIMX) {
+ p+=1;
+ x=o;
+ }
+ display_font_page(x,p,(u8 *)default_font+(*(s)<<3),f);
+ x+=sp;
+ s++;
+ }
+}
+
+/*
+ * global variables
+ */
+
+const char announce[]="betty - live from flash at 0x80000000! ;)\r\n";
+const char d1_txt[]="betty";
+const char d2_txt[]="- alphablend -";
+
/*
* main function
*/
int main() {
- char announce[]="betty - live from flash at 0x80000000! ;)\r\n";
t_button button;
u8 contrast;
/* pasue again */
/* announce */
- uart0_send_string(announce);
+ uart0_send_string((char *)announce);
while(1) {
display_fill_screen(DISPLAY_FILL_B);
break;
case BUTTON_1:
- display_draw_rectangle(20,20,40,40,
- DISPLAY_FILL_B,
- 0xff);
+ display_rectangle_page(4,2,60,5,DISPLAY_FILL_B,0xff);
break;
case BUTTON_2:
- display_draw_rectangle(50,50,40,40,
- DISPLAY_FILL_LG,
- 0x7f);
+ display_rectangle_page(40,5,50,5,DISPLAY_FILL_LG,0x7f);
break;
case BUTTON_3:
- display_draw_font(70,70,
- (u8 *)default_font+(0x33<<3),
- DISPLAY_FILL_LG,
- 0xff);
break;
case BUTTON_4:
- display_font_page(23,19,(u8 *)default_font+(0x34<<3),DISPLAY_FILL_B);
+ display_font_page(42,18,(u8 *)default_font+(0x34<<3),DISPLAY_FILL_B);
break;
case BUTTON_5:
- display_font_page(10,19,(u8 *)default_font+(0x35<<3),DISPLAY_FILL_DG);
+ display_font_page(50,18,(u8 *)default_font+(0x35<<3),DISPLAY_FILL_DG);
break;
case BUTTON_6:
- display_font_page(2,19,(u8 *)default_font+(0x36<<3),DISPLAY_FILL_LG);
+ display_font_page(58,18,(u8 *)default_font+(0x36<<3),DISPLAY_FILL_W);
break;
case BUTTON_7:
- display_draw_rectangle(2,2,4,4,
- DISPLAY_FILL_B,
- 0xff);
break;
case BUTTON_8:
- display_draw_rectangle(8,8,4,4,
- DISPLAY_FILL_DG,
- 0xff);
break;
case BUTTON_BETTY:
- display_rectangle_page(80,15,16,2,DISPLAY_FILL_B,0x7f);
- uart0_send_byte('b');
+ display_string_page(50,13,(u8 *)d1_txt,DISPLAY_FILL_B,0,8);
break;
case BUTTON_EXIT:
- display_rectangle_page(90,16,16,2,DISPLAY_FILL_LG,0x7f);
- uart0_send_byte('e');
+ display_string_page(10,8,(u8 *)d2_txt,DISPLAY_FILL_B,0,8);
break;
default:
display_clear_screen();