From: Erik M. <er...@us...> - 2002-02-17 19:54:51
|
Update of /cvsroot/blob/blob/src/commands In directory usw-pr-cvs1:/tmp/cvs-serv26300/src/commands Added Files: terminal.c reboot.c Log Message: Move "reset" and "reboot" commands to lib/commands/ --- NEW FILE: terminal.c --- /* * terminal.c: terminal reset functions * * Copyright (C) 1999 2000 2001 2002 Erik Mouw (J.A...@it...) * * $Id: terminal.c,v 1.1 2002/02/17 19:54:47 erikm Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ident "$Id: terminal.c,v 1.1 2002/02/17 19:54:47 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/serial.h> #include <blob/util.h> int reset_cmd(int argc, char *argv[]) { int i; serial_flush_output(); printf("c"); serial_flush_output(); for(i = 0; i < 100; i++) serial_write('\n'); serial_flush_output(); printf("c"); serial_flush_output(); serial_flush_input(); return 0; } char reset_help[] = "reset\n" "Reset terminal\n"; --- NEW FILE: reboot.c --- /* * reboot.c: Reboot board * * Copyright (C) 2001 Erik Mouw (J.A...@it...) * * $Id: reboot.c,v 1.1 2002/02/17 19:54:47 erikm Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ident "$Id: reboot.c,v 1.1 2002/02/17 19:54:47 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/serial.h> #include <blob/util.h> int reboot_cmd(int argc, char *argv[]) { printf("Rebooting...\n\n"); serial_flush_output(); reboot_system(); /* never reached, but anyway... */ return 0; } char reboot_help[] = "reboot\n" "Reboot system\n"; |