pwm test app
This commit is contained in:
parent
b038d17abe
commit
43d07d71b5
23
.cproject
23
.cproject
@ -136,6 +136,7 @@
|
|||||||
<buildTargets>
|
<buildTargets>
|
||||||
<target name="all" path="software/source/test/firmware/kernel/list" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="all" path="software/source/test/firmware/kernel/list" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments/>
|
||||||
<buildTarget>all</buildTarget>
|
<buildTarget>all</buildTarget>
|
||||||
<stopOnError>true</stopOnError>
|
<stopOnError>true</stopOnError>
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
@ -143,6 +144,7 @@
|
|||||||
</target>
|
</target>
|
||||||
<target name="clean" path="software/source/test/firmware/kernel/list" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="clean" path="software/source/test/firmware/kernel/list" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments/>
|
||||||
<buildTarget>clean</buildTarget>
|
<buildTarget>clean</buildTarget>
|
||||||
<stopOnError>true</stopOnError>
|
<stopOnError>true</stopOnError>
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
@ -150,7 +152,6 @@
|
|||||||
</target>
|
</target>
|
||||||
<target name="distclean" path="software/source" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="distclean" path="software/source" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
<buildArguments/>
|
|
||||||
<buildTarget>distclean</buildTarget>
|
<buildTarget>distclean</buildTarget>
|
||||||
<stopOnError>true</stopOnError>
|
<stopOnError>true</stopOnError>
|
||||||
<useDefaultCommand>false</useDefaultCommand>
|
<useDefaultCommand>false</useDefaultCommand>
|
||||||
@ -206,6 +207,7 @@
|
|||||||
</target>
|
</target>
|
||||||
<target name="all" path="software/test/firmware/kernel/list" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="all" path="software/test/firmware/kernel/list" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments/>
|
||||||
<buildTarget>all</buildTarget>
|
<buildTarget>all</buildTarget>
|
||||||
<stopOnError>true</stopOnError>
|
<stopOnError>true</stopOnError>
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
@ -237,6 +239,7 @@
|
|||||||
</target>
|
</target>
|
||||||
<target name="distclean" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="distclean" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments/>
|
||||||
<buildTarget>distclean</buildTarget>
|
<buildTarget>distclean</buildTarget>
|
||||||
<stopOnError>true</stopOnError>
|
<stopOnError>true</stopOnError>
|
||||||
<useDefaultCommand>false</useDefaultCommand>
|
<useDefaultCommand>false</useDefaultCommand>
|
||||||
@ -282,6 +285,22 @@
|
|||||||
<useDefaultCommand>false</useDefaultCommand>
|
<useDefaultCommand>false</useDefaultCommand>
|
||||||
<runAllBuilders>true</runAllBuilders>
|
<runAllBuilders>true</runAllBuilders>
|
||||||
</target>
|
</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">
|
<target name="msp430-ccrf example_radio_rx all" path="software/source/test" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
<buildArguments>APP=example_radio_rx BOARD=msp430-ccrf DEBUG=y</buildArguments>
|
<buildArguments>APP=example_radio_rx BOARD=msp430-ccrf DEBUG=y</buildArguments>
|
||||||
@ -308,6 +327,7 @@
|
|||||||
</target>
|
</target>
|
||||||
<target name="all" path="software/source/test/firmware/kernel/ringbuffer" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="all" path="software/source/test/firmware/kernel/ringbuffer" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments/>
|
||||||
<buildTarget>all</buildTarget>
|
<buildTarget>all</buildTarget>
|
||||||
<stopOnError>true</stopOnError>
|
<stopOnError>true</stopOnError>
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
@ -315,6 +335,7 @@
|
|||||||
</target>
|
</target>
|
||||||
<target name="clean" path="software/source/test/firmware/kernel/ringbuffer" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
<target name="clean" path="software/source/test/firmware/kernel/ringbuffer" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||||
<buildCommand>make</buildCommand>
|
<buildCommand>make</buildCommand>
|
||||||
|
<buildArguments/>
|
||||||
<buildTarget>clean</buildTarget>
|
<buildTarget>clean</buildTarget>
|
||||||
<stopOnError>true</stopOnError>
|
<stopOnError>true</stopOnError>
|
||||||
<useDefaultCommand>true</useDefaultCommand>
|
<useDefaultCommand>true</useDefaultCommand>
|
||||||
|
2
Makefile
2
Makefile
@ -83,7 +83,7 @@ doc:
|
|||||||
@$(MKDIR) $(DOC_DIR)
|
@$(MKDIR) $(DOC_DIR)
|
||||||
(cat $(DOXYFILE) ; echo "INPUT=$(DOC_SRC)" ; echo "OUTPUT_DIRECTORY=$(DOC_DIR)") | doxygen -
|
(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) $(EXE_DIR)
|
||||||
@$(MKDIR) $(MAP_DIR)
|
@$(MKDIR) $(MAP_DIR)
|
||||||
@$(MKDIR) $(SIZE_DIR)
|
@$(MKDIR) $(SIZE_DIR)
|
||||||
|
@ -9,8 +9,8 @@ endif
|
|||||||
CROSS_COMPILE=arm-none-eabi-
|
CROSS_COMPILE=arm-none-eabi-
|
||||||
|
|
||||||
INCLUDES += \
|
INCLUDES += \
|
||||||
/usr/lib/arm-none-eabi/include \
|
/opt/arm-2011.09/arm-none-eabi/include \
|
||||||
/usr/lib/gcc/arm-none-eabi/4.8/include
|
/opt/arm-2011.09/lib/gcc/arm-none-eabi/4.6.1/include
|
||||||
|
|
||||||
ifeq ($(DEBUG),y)
|
ifeq ($(DEBUG),y)
|
||||||
OPTIM = 0
|
OPTIM = 0
|
||||||
@ -35,7 +35,6 @@ CFLAGS += \
|
|||||||
-mfloat-abi=softfp \
|
-mfloat-abi=softfp \
|
||||||
-fdata-sections \
|
-fdata-sections \
|
||||||
-ffunction-sections
|
-ffunction-sections
|
||||||
# -D inline= -mthumb\
|
|
||||||
|
|
||||||
CPPCHECK_FLAGS += \
|
CPPCHECK_FLAGS += \
|
||||||
-D USE_STDPERIPH_DRIVER\
|
-D USE_STDPERIPH_DRIVER\
|
||||||
|
@ -23,9 +23,9 @@ struct shell_object {
|
|||||||
|
|
||||||
struct shell_object shell_object;
|
struct shell_object shell_object;
|
||||||
|
|
||||||
#define RX_STACK_SIZE 256
|
#define TH_STACK_SIZE 256
|
||||||
stack_t rx_stack[RX_STACK_SIZE];
|
stack_t th_stack[TH_STACK_SIZE];
|
||||||
struct thread_context rx_thread;
|
struct thread_context th_ctx;
|
||||||
|
|
||||||
static void parse(const char *buffer, unsigned int len)
|
static void parse(const char *buffer, unsigned int len)
|
||||||
{
|
{
|
||||||
@ -71,7 +71,7 @@ int shell_init(const struct driver *shell_device)
|
|||||||
return -1;
|
return -1;
|
||||||
list_init(&shell_object.command_list);
|
list_init(&shell_object.command_list);
|
||||||
shell_object.shell_device = shell_device;
|
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;
|
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)
|
ifeq ($(TEST_APP), shell)
|
||||||
include source/test/shell/shell.mk
|
include source/test/shell/shell.mk
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(TEST_APP), pwm)
|
||||||
|
include source/test/pwm/pwm.mk
|
||||||
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user