Skip to content

Fix unused variable warning #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ static void shell_format(const char * fmt, va_list va);

/**
* Process escaped character inside command args string
*
*
* @param argc The total number of arguments received for the command
* @param argv Pointers to the argument strings
*/
Expand Down Expand Up @@ -281,7 +281,7 @@ void shell_print_error(int error, const char * field)
#endif
}

void shell_task()
int shell_task()
{
// Number of characters written to buffer (this should be static var)
static uint16_t count = 0;
Expand All @@ -292,7 +292,7 @@ void shell_task()
char rxchar = 0;

if (!initialized)
return;
return retval;

// Process buffered output if enabled
if (obhandle != 0) {
Expand Down Expand Up @@ -358,7 +358,7 @@ void shell_task()
if (!strcmp_P(argv_list[0], list[i].shell_command_string))
#else
if (!strcmp(argv_list[0], list[i].shell_command_string))
#endif
#endif
{
// Run the appropriate function
retval = list[i].shell_program(argc, argv_list);
Expand All @@ -379,6 +379,7 @@ void shell_task()
shell_prompt();
}
}
return retval;
}

#ifdef ARDUINO
Expand Down
22 changes: 11 additions & 11 deletions Shell.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

Author website: http://www.geekfactory.mx
Author e-mail: ruben at geekfactory dot mx
*/
Expand Down Expand Up @@ -185,19 +185,19 @@ extern "C" {
* otherwise.
*/
bool shell_init(shell_reader_t reader, shell_writer_t writer, char * msg);

/**
* @brief Enables internal output buffer for output chars
*
*
* Call this function to enable the use of an internal buffer to temporary store
* characters that will be sent to a remote device. This function is meant to be
* used when the communication channel performs better when many characters are
* written at the same time. For example TCP/IP sockets perform better if a group
* used when the communication channel performs better when many characters are
* written at the same time. For example TCP/IP sockets perform better if a group
* of characters are sent on a single segment.
*
*
* The content of the internal buffer is written when the it is full or if
* 200 milliseconds have elapsed since the last character write on the buffer.
*
*
* @param writer The callback function used to write a group of characters on the
* stream.
*/
Expand Down Expand Up @@ -228,10 +228,10 @@ extern "C" {

/**
* @brief Prints a character to the terminal
*
*
* Prints a single character to the terminal screen, it exposes the functionality
* of the shell_writer callback function
*
*
* @param c A character to print to the terminal screen
*/
void shell_putc(char c);
Expand Down Expand Up @@ -301,7 +301,7 @@ extern "C" {
* this function should be called frequently so it can handle the input from the
* data stream.
*/
void shell_task();
int shell_task();

#ifdef ARDUINO
/**
Expand Down Expand Up @@ -333,7 +333,7 @@ extern "C" {
* specifiers (subsequences beginning with '%'), the additional arguments
* following format are formatted and inserted in the resulting string
* replacing their respective specifiers.
*
*
* This function is designed to be used with strings stored in flash.
*
* This function implements it's own mechanism for text formatting. It doesn't
Expand Down