X-Git-Url: https://hackdaworld.org/gitweb/?a=blobdiff_plain;f=betty%2Fbetty.c;h=31bc5a2458772c0b388bda8b27016bd6796eacb9;hb=b4ca71fc214ba3c58cec25661ba1f81cf7b1b871;hp=f2ce2e5fba098487845e8c310c3252c7ca91b999;hpb=90fa4f3eca580f497dd24e9b3afd818d3b1f7054;p=my-code%2Farm.git diff --git a/betty/betty.c b/betty/betty.c index f2ce2e5..31bc5a2 100644 --- a/betty/betty.c +++ b/betty/betty.c @@ -5,9 +5,54 @@ * */ +/* includes */ +#include "betty.h" + +/* + * functions + */ + +#define cc1100_init spi1_init(8,SPI_MASTER,8) + +/* + * main function + */ + int main() { + char buf[]="betty - live from flash at 0x80000000! ;)\r\n"; + t_button button; + + /* system init */ + pll_init(); + + /* uart init */ + uart0_init(); + + /* display init */ + bl_init(); + + /* button init */ + button_init(&button); + button_set_retries(&button,100); + + /* + * start it ... + */ + + pause(0xffffff); + bl_toggle(); + + while(1) { + pause(0x0fffff); + /* button test! */ + if(button_get_event(&button)) { + uart0_send_string(buf); + if(button.key[0]==BUTTON_POWER) + bl_toggle(); + } + } return 0; }