Michael Spencer / Smoothie

Dependencies:   mbed

Fork of Smoothie by Stéphane Cachat

Committer:
Michael J. Spencer
Date:
Fri Feb 28 18:52:52 2014 -0800
Revision:
2:1df0b61d3b5a
Parent:
0:31e91bb0ef3c
Update to latest Smoothie.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Michael J. Spencer 2:1df0b61d3b5a 1 /*
scachat 0:31e91bb0ef3c 2 This file is part of Smoothie (http://smoothieware.org/). The motion control part is heavily based on Grbl (https://github.com/simen/grbl).
scachat 0:31e91bb0ef3c 3 Smoothie 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 3 of the License, or (at your option) any later version.
scachat 0:31e91bb0ef3c 4 Smoothie 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.
Michael J. Spencer 2:1df0b61d3b5a 5 You should have received a copy of the GNU General Public License along with Smoothie. If not, see <http://www.gnu.org/licenses/>.
scachat 0:31e91bb0ef3c 6 */
scachat 0:31e91bb0ef3c 7
scachat 0:31e91bb0ef3c 8
scachat 0:31e91bb0ef3c 9 #ifndef simpleshell_h
scachat 0:31e91bb0ef3c 10 #define simpleshell_h
scachat 0:31e91bb0ef3c 11
scachat 0:31e91bb0ef3c 12 #include "libs/Kernel.h"
scachat 0:31e91bb0ef3c 13 #include "libs/nuts_bolts.h"
scachat 0:31e91bb0ef3c 14 #include "libs/utils.h"
scachat 0:31e91bb0ef3c 15 #include "libs/StreamOutput.h"
scachat 0:31e91bb0ef3c 16
Michael J. Spencer 2:1df0b61d3b5a 17 class SimpleShell : public Module
Michael J. Spencer 2:1df0b61d3b5a 18 {
Michael J. Spencer 2:1df0b61d3b5a 19 public:
Michael J. Spencer 2:1df0b61d3b5a 20 SimpleShell() {}
scachat 0:31e91bb0ef3c 21
Michael J. Spencer 2:1df0b61d3b5a 22 void on_module_loaded();
Michael J. Spencer 2:1df0b61d3b5a 23 void on_console_line_received( void *argument );
Michael J. Spencer 2:1df0b61d3b5a 24 void on_gcode_received(void *argument);
Michael J. Spencer 2:1df0b61d3b5a 25 void on_second_tick(void *);
scachat 0:31e91bb0ef3c 26
Michael J. Spencer 2:1df0b61d3b5a 27 private:
Michael J. Spencer 2:1df0b61d3b5a 28 void ls_command(string parameters, StreamOutput *stream );
Michael J. Spencer 2:1df0b61d3b5a 29 void cd_command(string parameters, StreamOutput *stream );
Michael J. Spencer 2:1df0b61d3b5a 30 void delete_file_command(string parameters, StreamOutput *stream );
Michael J. Spencer 2:1df0b61d3b5a 31 void pwd_command(string parameters, StreamOutput *stream );
Michael J. Spencer 2:1df0b61d3b5a 32 void cat_command(string parameters, StreamOutput *stream );
Michael J. Spencer 2:1df0b61d3b5a 33 void rm_command(string parameters, StreamOutput *stream );
Michael J. Spencer 2:1df0b61d3b5a 34 void break_command(string parameters, StreamOutput *stream );
Michael J. Spencer 2:1df0b61d3b5a 35 void reset_command(string parameters, StreamOutput *stream );
Michael J. Spencer 2:1df0b61d3b5a 36 void dfu_command(string parameters, StreamOutput *stream );
Michael J. Spencer 2:1df0b61d3b5a 37 void help_command(string parameters, StreamOutput *stream );
Michael J. Spencer 2:1df0b61d3b5a 38 void version_command(string parameters, StreamOutput *stream );
Michael J. Spencer 2:1df0b61d3b5a 39 void get_command(string parameters, StreamOutput *stream );
Michael J. Spencer 2:1df0b61d3b5a 40 void set_temp_command(string parameters, StreamOutput *stream );
Michael J. Spencer 2:1df0b61d3b5a 41 void mem_command(string parameters, StreamOutput *stream );
scachat 0:31e91bb0ef3c 42
Michael J. Spencer 2:1df0b61d3b5a 43 void net_command( string parameters, StreamOutput *stream);
Michael J. Spencer 2:1df0b61d3b5a 44
Michael J. Spencer 2:1df0b61d3b5a 45 void load_command( string parameters, StreamOutput *stream);
Michael J. Spencer 2:1df0b61d3b5a 46 void save_command( string parameters, StreamOutput *stream);
Michael J. Spencer 2:1df0b61d3b5a 47
Michael J. Spencer 2:1df0b61d3b5a 48 bool parse_command(unsigned short cs, string args, StreamOutput *stream);
Michael J. Spencer 2:1df0b61d3b5a 49
Michael J. Spencer 2:1df0b61d3b5a 50 typedef void (SimpleShell::*PFUNC)(string parameters, StreamOutput *stream);
Michael J. Spencer 2:1df0b61d3b5a 51 typedef struct {
Michael J. Spencer 2:1df0b61d3b5a 52 unsigned short command_cs;
Michael J. Spencer 2:1df0b61d3b5a 53 PFUNC pfunc;
Michael J. Spencer 2:1df0b61d3b5a 54 } ptentry_t;
Michael J. Spencer 2:1df0b61d3b5a 55
Michael J. Spencer 2:1df0b61d3b5a 56 static ptentry_t commands_table[];
Michael J. Spencer 2:1df0b61d3b5a 57 int reset_delay_secs;
scachat 0:31e91bb0ef3c 58 };
scachat 0:31e91bb0ef3c 59
scachat 0:31e91bb0ef3c 60
scachat 0:31e91bb0ef3c 61 #endif