pwm test app
This commit is contained in:
parent
b038d17abe
commit
43d07d71b5
23
.cproject
23
.cproject
@ -136,6 +136,7 @@
|
||||
<buildTargets>
|
||||
<target name="all" path="software/source/test/firmware/kernel/list" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>all</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
@ -143,6 +144,7 @@
|
||||
</target>
|
||||
<target name="clean" path="software/source/test/firmware/kernel/list" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>clean</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
@ -150,7 +152,6 @@
|
||||
</target>
|
||||
<target name="distclean" path="software/source" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>distclean</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>false</useDefaultCommand>
|
||||
@ -206,6 +207,7 @@
|
||||
</target>
|
||||
<target name="all" path="software/test/firmware/kernel/list" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>all</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
@ -237,6 +239,7 @@
|
||||
</target>
|
||||
<target name="distclean" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>distclean</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>false</useDefaultCommand>
|
||||
@ -282,6 +285,22 @@
|
||||
<useDefaultCommand>false</useDefaultCommand>
|
||||
<runAllBuilders>true</runAllBuilders>
|
||||
</target>
|
||||
<target name="test pwm" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments>TEST_APP=pwm BOARD=stm32f4-discovery DEBUG=y</buildArguments>
|
||||
<buildTarget>test</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>false</useDefaultCommand>
|
||||
<runAllBuilders>true</runAllBuilders>
|
||||
</target>
|
||||
<target name="test pwm install" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments>TEST_APP=pwm BOARD=stm32f4-discovery DEBUG=y</buildArguments>
|
||||
<buildTarget>install</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>false</useDefaultCommand>
|
||||
<runAllBuilders>true</runAllBuilders>
|
||||
</target>
|
||||
<target name="msp430-ccrf example_radio_rx all" path="software/source/test" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments>APP=example_radio_rx BOARD=msp430-ccrf DEBUG=y</buildArguments>
|
||||
@ -308,6 +327,7 @@
|
||||
</target>
|
||||
<target name="all" path="software/source/test/firmware/kernel/ringbuffer" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>all</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
@ -315,6 +335,7 @@
|
||||
</target>
|
||||
<target name="clean" path="software/source/test/firmware/kernel/ringbuffer" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>clean</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
|
2
Makefile
2
Makefile
@ -83,7 +83,7 @@ doc:
|
||||
@$(MKDIR) $(DOC_DIR)
|
||||
(cat $(DOXYFILE) ; echo "INPUT=$(DOC_SRC)" ; echo "OUTPUT_DIRECTORY=$(DOC_DIR)") | doxygen -
|
||||
|
||||
test: check $(OBJECTS) $(ASM_OBJECTS)
|
||||
test: $(OBJECTS) $(ASM_OBJECTS)
|
||||
@$(MKDIR) $(EXE_DIR)
|
||||
@$(MKDIR) $(MAP_DIR)
|
||||
@$(MKDIR) $(SIZE_DIR)
|
||||
|
@ -9,8 +9,8 @@ endif
|
||||
CROSS_COMPILE=arm-none-eabi-
|
||||
|
||||
INCLUDES += \
|
||||
/usr/lib/arm-none-eabi/include \
|
||||
/usr/lib/gcc/arm-none-eabi/4.8/include
|
||||
/opt/arm-2011.09/arm-none-eabi/include \
|
||||
/opt/arm-2011.09/lib/gcc/arm-none-eabi/4.6.1/include
|
||||
|
||||
ifeq ($(DEBUG),y)
|
||||
OPTIM = 0
|
||||
@ -35,7 +35,6 @@ CFLAGS += \
|
||||
-mfloat-abi=softfp \
|
||||
-fdata-sections \
|
||||
-ffunction-sections
|
||||
# -D inline= -mthumb\
|
||||
|
||||
CPPCHECK_FLAGS += \
|
||||
-D USE_STDPERIPH_DRIVER\
|
||||
|
@ -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
|
||||
ifeq ($(TEST_APP), pwm)
|
||||
include source/test/pwm/pwm.mk
|
||||
endif
|
||||
|
Loading…
Reference in New Issue
Block a user