Code for our FYDP -only one IMU works right now -RTOS is working
Embed:
(wiki syntax)
Show/hide line numbers
tinysh.h
00001 /* 00002 * tinysh.h 00003 * 00004 * Header for minimal portable shell 00005 * 00006 * Copyright (C) 2001 Michel Gutierrez <mig@nerim.net> 00007 * 00008 * This library is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU Lesser General Public 00010 * License as published by the Free Software Foundation; either 00011 * version 2.1 of the License, or (at your option) any later version. 00012 * 00013 * This library is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 * Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public 00019 * License along with this library; if not, write to the Free 00020 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00021 */ 00022 00023 typedef void (*tinysh_fnt_t)(int argc, char **argv); 00024 00025 typedef struct tinysh_cmd_t { 00026 struct tinysh_cmd_t *parent; /* 0 if top level command */ 00027 char *name; /* command input name, not 0 */ 00028 char *help; /* help string, can be 0 */ 00029 char *usage; /* usage string, can be 0 */ 00030 tinysh_fnt_t function; /* function to launch on cmd, can be 0 */ 00031 void *arg; /* current argument when function called */ 00032 struct tinysh_cmd_t *next; /* must be set to 0 at init */ 00033 struct tinysh_cmd_t *child; /* must be set to 0 at init */ 00034 } tinysh_cmd_t; 00035 00036 #ifdef __cplusplus 00037 extern "C" { 00038 #endif 00039 00040 00041 extern int echo; 00042 00043 /* 00044 * function void tinysh_char_out(unsigned char) must be provided by 00045 * the application 00046 */ 00047 void tinysh_char_out(unsigned char c); 00048 00049 /* 00050 * Functions below are provided by the tinysh module 00051 */ 00052 00053 /* new character input */ 00054 void tinysh_char_in(unsigned char c); 00055 00056 /* add a new command */ 00057 void tinysh_add_command(tinysh_cmd_t *cmd); 00058 00059 /* change tinysh prompt */ 00060 void tinysh_set_prompt(char *str); 00061 00062 /* get command argument back */ 00063 void *tinysh_get_arg(); 00064 00065 /* provide conversion string to scalar (decimal or hexadecimal) */ 00066 unsigned long tinysh_atoxi(char *s); 00067 00068 #ifdef __cplusplus 00069 } 00070 #endif 00071 00072
Generated on Wed Jul 13 2022 10:32:23 by 1.7.2