test app implementation for os

This commit is contained in:
tkl
2016-08-02 14:10:11 +02:00
parent 35af737f68
commit 1859174c9c
10 changed files with 295 additions and 14 deletions

View File

@@ -86,7 +86,11 @@ static const struct uart __uart_1 = {
&console_buffer,
};
#ifdef TEST_APP
static const struct driver uart_1 = {
#else
const struct driver uart_1 = {
#endif
DRIVER_TYPE_UART,
&__uart_1,
};
@@ -109,12 +113,16 @@ static const struct stm32f4_gpio stm32_f4_discovery_led_3 = {
NULL
};
#ifdef TEST_APP
static const struct gpio __led_3 = {
#else
const struct gpio __led_3 = {
#endif
(void*)&stm32_f4_discovery_led_3,
&gpio_fp
};
const struct driver led_3 = {
static const struct driver led_3 = {
DRIVER_TYPE_GPIO,
&__led_3,
};
@@ -142,7 +150,11 @@ static const struct gpio __led_4 = {
&gpio_fp
};
#ifdef TEST_APP
static const struct driver led_4 = {
#else
const struct driver led_4 = {
#endif
DRIVER_TYPE_GPIO,
&__led_4,
};
@@ -170,7 +182,11 @@ static const struct gpio __led_5 = {
&gpio_fp
};
#ifdef TEST_APP
static const struct driver led_5 = {
#else
const struct driver led_5 = {
#endif
DRIVER_TYPE_GPIO,
&__led_5,
};
@@ -198,7 +214,11 @@ static const struct gpio __led_6 = {
&gpio_fp
};
#ifdef TEST_APP
static const struct driver led_6 = {
#else
const struct driver led_6 = {
#endif
DRIVER_TYPE_GPIO,
&__led_6,
};

View File

@@ -52,7 +52,8 @@ static void rx_func(void *arg)
ret = read(shell_object.shell_device, &buffer[index],
sizeof(buffer) / sizeof(buffer[0]) - index);
if(ret) {
if(buffer[index + ret - 1] == '\n') {
if((buffer[index + ret - 1] == '\n') || (buffer[index + ret - 1] == '\r')) {
buffer[index + ret - 1] = '\n';
parse(buffer, index + ret);
index = 0;
}