int main() { init_com(); init_lcd_hardware(); g_clear_screen(); draw_color = PIXEL_ON; /* uint16_t xc = 0, yc = 0; for (xc = 0; xc < 40; xc += 8) for (yc = 0; yc < 240; yc += 64) copy_logo(yc, xc); */ sei(); lcd_on(); while (1) { if (activate_hypnotoad_flag) { activate_hypnotoad_flag = 0; g_clear_screen(); hypnotoad(); } handle_com(); } }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); startInit(); myCom = NULL; ui->qter->setText("T C M"); createMenuBar(); //自动加入串口 本软件自动查询注册表来自动添加串口 init_com(); ui->statusBar->showMessage(tr("Edit By TCM&Enjoy it!")); }
void kernel_main() { init_process(); init_dispatcher(); init_ipc(); init_interrupts(); init_null_process(); init_timer(); init_com(); init_keyb(); init_ne2k(); init_shell(); while (1); }
int main(int argc, char **argv) { int alive, kill, live; openlog("angeld",LOG_PID | LOG_CONS,LOG_USER); /* Set defaults */ kill = 0; live = 0; /* Parse arguments */ if(argc <= 1) goto help; if(strcmp(argv[1],"start") == 0) live = 1; else if(strcmp(argv[1],"restart") == 0) kill = live = 1; else if(strcmp(argv[1],"stop") == 0) kill = 1; else { /* Fools! */ help: puts("usage: angeld (start|restart|stop)"); exit(EXIT_SUCCESS); } /* Check PID file */ if(kill || live) { alive = is_alive(); if(kill && !alive) syslog(LOG_INFO,"nothing to kill"); kill &= alive; if(!kill && live && alive) syslog(LOG_INFO,"angeld already alive"); live &= kill || !alive; } /* To be or not to be... */ if(kill) kill_daemon(); if(live) { make_daemon(); init_com(); monitor(); } closelog(); return !(kill || live); }
void kernel_main() { init_process(); init_dispatcher(); init_ipc(); init_interrupts(); init_null_process(); init_timer(); #if VGA_MODE_ENABLED init_vga_mode(); #endif init_com(); init_keyb(); clear_kernel_window(); init_ne_driver(); init_em(); init_shell(); while (1); }
bool ConfigureDevice(int theDevice, unsigned int baudRate, unsigned char dataBits, unsigned char parity) { int baud, bits, param; switch (baudRate) { case 1200: baud = BAUD12; /* 1200 baud */ break; case 2400: baud = BAUD24; /* 2400 baud */ break; case 4800: baud = BAUD48; /* 4800 baud */ break; case 9600: baud = BAUD96; /* 9600 baud */ break; case 19200: baud = BAUD19; /* 19200 */ break; case 38400: baud = BAUD38; /* 38400 */ break; case 57600: baud = BAUD57; /* 57600 */ break; case 115200: baud = BAUD11; /* 115200 */ break; default: baud = 0; break; } switch (dataBits) { case 7: bits = WLEN7; break; case 8: bits = WLEN8; break; default: bits = 0; break; } switch (parity) { case 0: param = 0; break; case 1: param = PARODD; break; case 2: param = PAREVN; break; default: break; } if (!bits || !baud) return false; param = param | bits; init_com(theDevice, baud, param); return true; }