close #30 added overwritable help command parameter and fixed some compiler issues (some of them only appeared when compiling with optimization)

This commit is contained in:
prozessorkern
2020-03-01 17:53:27 +01:00
parent 4f9ff4fe3c
commit c04accdb55
10 changed files with 65 additions and 14 deletions

View File

@@ -4,6 +4,8 @@
static shellmatta_retCode_t writeFct(const char* data, uint32_t length)
{
(void)data;
(void)length;
return SHELLMATTA_OK;
}

View File

@@ -9,7 +9,7 @@ static uint32_t write_length;
static shellmatta_retCode_t writeFct(const char* data, uint32_t length)
{
write_callCnt ++;
strncpy(write_data, data, length);
memcpy(write_data, data, length);
write_length = length;
return SHELLMATTA_OK;
}

View File

@@ -9,7 +9,7 @@ static uint32_t write_length;
static shellmatta_retCode_t writeFct(const char* data, uint32_t length)
{
write_callCnt ++;
strncpy(write_data, data, length);
memcpy(write_data, data, length);
write_length = length;
return SHELLMATTA_OK;
}

View File

@@ -3,13 +3,13 @@
#include <string.h>
static uint32_t write_callCnt = 0u;
static char write_data[10];
static char write_data[10u];
static uint32_t write_length;
static shellmatta_retCode_t writeFct(const char* data, uint32_t length)
{
write_callCnt ++;
strncpy(write_data, data, length);
memcpy(write_data, data, length);
write_length = length;
return SHELLMATTA_OK;
}

View File

@@ -9,7 +9,7 @@ static uint32_t write_idx;
static shellmatta_retCode_t writeFct(const char* data, uint32_t length)
{
write_callCnt ++;
strncpy(&write_data[write_idx], data, length);
memcpy(&write_data[write_idx], data, length);
write_idx += length;
return SHELLMATTA_OK;
}