MCPcopy Create free account
hub / github.com/coreboot/coreboot / loop

Function loop

payloads/coreinfo/coreinfo.c:228–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226}
227
228static void loop(void)
229{
230 int key;
231
232 center(0, CONFIG_COREINFO_NAME " " CONFIG_COREINFO_VERSION);
233 print_no_modules_selected();
234 refresh();
235
236 curwin = first_nonempty_category();
237 print_menu();
238 print_submenu(&categories[curwin]);
239 redraw_module(&categories[curwin]);
240
241 halfdelay(10);
242
243 while (1) {
244 int ch = -1;
245
246#if CONFIG(SHOW_DATE_TIME)
247 print_time_and_date();
248 wrefresh(menuwin);
249#endif
250
251 key = getch();
252
253 if (key == ERR)
254 continue;
255
256 if (key >= KEY_F(1) && key <= KEY_F(9))
257 ch = key - KEY_F(1);
258 if (key >= '1' && key <= '9')
259 ch = key - '1';
260
261 if (ch >= 0 && (unsigned int)ch <= ARRAY_SIZE(categories)) {
262 if (ch == ARRAY_SIZE(categories))
263 continue;
264 if (categories[ch].count == 0)
265 continue;
266
267 curwin = ch;
268 print_submenu(&categories[curwin]);
269 redraw_module(&categories[curwin]);
270 continue;
271 }
272
273 if (key == KEY_ESC)
274 return;
275
276 handle_category_key(&categories[curwin], key);
277 }
278}
279
280int main(int argc, char **argv)
281{

Callers 1

mainFunction · 0.85

Calls 11

centerFunction · 0.85
refreshFunction · 0.85
first_nonempty_categoryFunction · 0.85
print_menuFunction · 0.85
print_submenuFunction · 0.85
redraw_moduleFunction · 0.85
print_time_and_dateFunction · 0.85
handle_category_keyFunction · 0.85
halfdelayFunction · 0.50
wrefreshFunction · 0.50

Tested by

no test coverage detected