4 #include <base/fifo/fifo.h>
\r
5 #include <comm/uart/uart.h>
\r
6 #include <other/kbd/kbd.h>
\r
7 #include <base/wait/wait.h>
\r
8 #include <time/scheduler/scheduler.h>
\r
9 #include <time/hour/hour.h>
\r
10 //#include <other/menu/menu.h>
\r
11 #include <other/lcd/lcd.h>
\r
18 void process(uint8_t c)
\r
30 nb=scanf("%s %d",tab,&add);
\r
32 if( !strcmp(tab,"set"))
\r
35 printf("\r\n>> time set to %d\r\n",add);
\r
37 else if (!strcmp(tab,"get"))
\r
38 printf("\r\n>> %d secondes\r\n",time_get_s());
\r
39 else if (!strcmp(tab,"show"))
\r
40 printf("\r\n>> Value at 0x%X : %d\r\n",add,*(uint8_t *)add);
\r
42 printf("\r\n>> command not found\r\n");
\r
49 /* void menu_print(void) */
\r
51 /* int8_t tmp=menu_current(); */
\r
53 /* menu_init_brother_list(); */
\r
56 /* while(tmp != 0) */
\r
58 /* fprintf(lcd,"|"); */
\r
59 /* tmp=menu_up(tmp); */
\r
61 /* fprintf(lcd,"%s%s",(menu_is_leaf(menu_current())?"* ":"> "),menu_txt(menu_current())); */
\r
67 /* void menu_control(uint8_t c) */
\r
70 /* menu_set(menu_left(menu_current())); */
\r
71 /* else if(c=='8') */
\r
72 /* menu_set(menu_right(menu_current())); */
\r
73 /* else if(c=='*') */
\r
75 /* if(menu_action_is_allowed()) */
\r
76 /* menu_action_disallow(); */
\r
78 /* menu_set(menu_up(menu_current())); */
\r
80 /* else if(c=='#') */
\r
82 /* if(menu_is_leaf(menu_current())) */
\r
83 /* menu_action_allow(); */
\r
85 /* menu_set(menu_down(menu_current())); */
\r
91 FIFO_DECLARE_TYPE(g_read_fifo, uint8_t, 16);
\r
92 FIFO_DEFINE(g_read_fifo);
\r
93 FIFO_DEFINE_FUNCTIONS(uint8_t);
\r
95 int kbd_get_next(void)
\r
99 if(FIFO_IS_FULL(g_read_fifo))
\r
102 FIFO_DEL_ELT(&c, g_read_fifo);
\r
108 /* void menu_add_char(uint8_t c) */
\r
115 /* FIFO_ADD_ELT(' ', g_read_fifo, uint8_t); */
\r
116 /* menu_action_disallow(); */
\r
117 /* kbd_register_event(menu_control); */
\r
118 /* fscanf(lcd,"%d",&val); */
\r
119 /* time_set(val,0); */
\r
120 /* printf("\r\nLCD: time set to %d\r\n",val); */
\r
121 /* menu_print(); */
\r
126 /* FIFO_ADD_ELT(c, g_read_fifo, uint8_t); */
\r
135 static uint8_t a=0;
\r
148 // lcd_init(LCD_DISP_ON);
\r
151 FIFO_INIT(g_read_fifo, uint8_t, 16);
\r
153 // scheduler_add_periodical_event(leds, 20000l/SCHEDULER_UNIT);
\r
154 /* ajoute la scrutation du clavier */
\r
155 // scheduler_add_periodical_event(kbd_manage, 100);
\r
157 /* envoie les caracteres du clavier vers le LCD */
\r
158 // kbd_register_event(menu_control);
\r
160 /* appele la fonction process a chaque reception de caractere */
\r
161 // uart0_register_rx_event(process);
\r
163 /* creation du device uart */
\r
164 fdevopen(uart0_dev_send,uart0_dev_recv);
\r
166 /* creation du device lcd */
\r
167 // lcd=fdevopen(lcd_dev_putc,kbd_dev_get_next);
\r
174 /* printf_P(PSTR("\r\nWelcome to this demo\r\n")); */
\r
175 /* printf_P(PSTR("\r\n")); */
\r
176 /* printf_P(PSTR(" \r\n")); */
\r
177 /* printf_P(PSTR(" .__,. ___. \r\n")); */
\r
178 /* printf_P(PSTR(" _%i~` -'i;_ \r\n")); */
\r
179 /* printf_P(PSTR(" _=Xr~ '{a__ \r\n")); */
\r
180 /* printf_P(PSTR(" <ln2 :|2S=; \r\n")); */
\r
181 /* printf_P(PSTR(" _xnxn :=oox>. \r\n")); */
\r
182 /* printf_P(PSTR(" .nnvno ..______.. :=oonss \r\n")); */
\r
183 /* printf_P(PSTR(" .onvnn_. __s>ss%xixaii_,_ =Invv1n \r\n")); */
\r
184 /* printf_P(PSTR(" :vnnnnns_+''^~-` ---^^'(;sxvnnnn1 \r\n")); */
\r
185 /* printf_P(PSTR(" .__onvnvnxn_,. __svvvnnnnv_, \r\n")); */
\r
186 /* printf_P(PSTR(" _i%vnn2nvnnvnvn2n2nss;.;<aIvo2nxxnnvnx1nnnas_. \r\n")); */
\r
187 /* printf_P(PSTR(" i)nnvnnnnxnvnnnnvnnnn1(-=]SIvnnvnnvnnnnnnnnnnx>_ \r\n")); */
\r
188 /* printf_P(PSTR(" =innonn|=;::+<innnvvvvv .:o2vvo2oo===;==)vnvvn2:. \r\n")); */
\r
189 /* printf_P(PSTR(" _Jn!^~` <xs;. -^11oc+ **v}!-` i<a;. --'{lu( \r\n")); */
\r
190 /* printf_P(PSTR(" Xc| Ixoc| .: .: vvn(. nc| \r\n")); */
\r
191 /* printf_P(PSTR(" ..v; ~)n1x .)n21vvnoIl ._XuI' ~<i \r\n")); */
\r
192 /* printf_P(PSTR(" .i; =ix2v; =innnnnn=+ :)onv. =i \r\n")); */
\r
193 /* printf_P(PSTR(" i; -'o1v_,.=vnvnvxo+| =snxI~~ -+ \r\n")); */
\r
194 /* printf_P(PSTR(" +: -)ol=;)nnvvnnvvv:)n+; . \r\n")); */
\r
195 /* printf_P(PSTR(" .<xxnvnvv1nnn<, . \r\n")); */
\r
196 /* printf_P(PSTR(" ===. :iooonnnnno2ovvn1l |; \r\n")); */
\r
197 /* printf_P(PSTR(" --'=<__s_asxuonx1}|^`---'**nnnnnaii_s__/+^^ \r\n")); */
\r
198 /* printf_P(PSTR(" ==+==;=; .=;;::=.. \r\n")); */
\r
199 /* printf_P(PSTR("\r\n")); */
\r
200 /* printf_P(PSTR(" Microb Technology\r\n")); */
\r
201 /* printf_P(PSTR("\r\n")); */
\r
202 // printf("\r\n>> Time set to %d seconds\r\n",time_get_s());
\r
208 /* uart0_send(0x00); */
\r
210 /* uart0_send(0x03); */
\r
212 /* uart0_send(0xAA); */
\r
214 /* uart0_send(0x55); */
\r
216 /* uart0_send(0xFF); */
\r
219 printf("\r\n>> Time set to %d seconds\r\n",time_get_s());
\r