pwm test app
This commit is contained in:
@@ -23,9 +23,9 @@ struct shell_object {
|
||||
|
||||
struct shell_object shell_object;
|
||||
|
||||
#define RX_STACK_SIZE 256
|
||||
stack_t rx_stack[RX_STACK_SIZE];
|
||||
struct thread_context rx_thread;
|
||||
#define TH_STACK_SIZE 256
|
||||
stack_t th_stack[TH_STACK_SIZE];
|
||||
struct thread_context th_ctx;
|
||||
|
||||
static void parse(const char *buffer, unsigned int len)
|
||||
{
|
||||
@@ -71,7 +71,7 @@ int shell_init(const struct driver *shell_device)
|
||||
return -1;
|
||||
list_init(&shell_object.command_list);
|
||||
shell_object.shell_device = shell_device;
|
||||
thread_create(&rx_thread, rx_stack, RX_STACK_SIZE, rx_func, NULL, THREAD_PRIO_LOW);
|
||||
thread_create(&th_ctx, th_stack, TH_STACK_SIZE, rx_func, NULL, THREAD_PRIO_LOW);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
35
source/test/pwm/main.c
Normal file
35
source/test/pwm/main.c
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* main.c
|
||||
*
|
||||
* Created on: Aug 2, 2016
|
||||
* Author: tkl
|
||||
*/
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "driver.h"
|
||||
#include "board.h"
|
||||
#include "stack.h"
|
||||
#include "queue.h"
|
||||
#include "kernel.h"
|
||||
#include "driver.h"
|
||||
#include "list.h"
|
||||
#include "shell.h"
|
||||
|
||||
#define TH_STACK_SIZE 256
|
||||
stack_t th_stack[TH_STACK_SIZE];
|
||||
struct thread_context th_ctx;
|
||||
static void th_func(void *arg)
|
||||
{
|
||||
while(1) {
|
||||
}
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
thread_create(&th_ctx, th_stack, TH_STACK_SIZE, th_func, NULL, THREAD_PRIO_LOW);
|
||||
|
||||
schedule_start();
|
||||
|
||||
return 0;
|
||||
}
|
4
source/test/pwm/pwm.mk
Normal file
4
source/test/pwm/pwm.mk
Normal file
@@ -0,0 +1,4 @@
|
||||
CHECK_FOLDER += source/test/pwm
|
||||
SUB_FOLDER += source/test/pwm
|
||||
INCLUDES += source/test/pwm
|
||||
DOC_SRC += source/test/pwm
|
@@ -1,3 +1,6 @@
|
||||
ifeq ($(TEST_APP), shell)
|
||||
include source/test/shell/shell.mk
|
||||
endif
|
||||
endif
|
||||
ifeq ($(TEST_APP), pwm)
|
||||
include source/test/pwm/pwm.mk
|
||||
endif
|
||||
|
Reference in New Issue
Block a user