From f6733ae0d84b474ed9345d9390b8ec76cf37c6e6 Mon Sep 17 00:00:00 2001 From: tkl Date: Fri, 29 Jul 2016 09:01:02 +0200 Subject: [PATCH] app level adapted --- .cproject | 2 +- config/make/rules.mk | 3 -- source/application/application.mk | 9 +--- .../example_semaphore/example_semaphore.mk | 4 -- source/application/example_semaphore/main.c | 51 ------------------- source/application/{test => }/main.c | 0 source/application/test/test.mk | 4 -- 7 files changed, 3 insertions(+), 70 deletions(-) delete mode 100755 source/application/example_semaphore/example_semaphore.mk delete mode 100644 source/application/example_semaphore/main.c rename source/application/{test => }/main.c (100%) delete mode 100755 source/application/test/test.mk diff --git a/.cproject b/.cproject index 852a121..e51b36f 100755 --- a/.cproject +++ b/.cproject @@ -205,7 +205,7 @@ make - APP=test BOARD=stm32f4-discovery DEBUG=y + BOARD=stm32f4-discovery DEBUG=y all true false diff --git a/config/make/rules.mk b/config/make/rules.mk index d0d3dc7..f09f8a2 100755 --- a/config/make/rules.mk +++ b/config/make/rules.mk @@ -2,9 +2,6 @@ ROOT_DIR := $(shell pwd | sed "s/\/source//g") -ifeq ($(BOARD), msp430-ccrf) -include $(ROOT_DIR)/config/make/msp430.mk -endif ifeq ($(BOARD), stm32f4-discovery) include $(ROOT_DIR)/config/make/stm32f4xx.mk endif diff --git a/source/application/application.mk b/source/application/application.mk index 51cfe63..7d90394 100755 --- a/source/application/application.mk +++ b/source/application/application.mk @@ -1,9 +1,4 @@ +CHECK_FOLDER += application +SUB_FOLDER += application INCLUDES += application DOC_SRC += application - -ifeq ($(APP), example_semaphore) -include application/example_semaphore/example_semaphore.mk -endif -ifeq ($(APP), test) -include application/test/test.mk -endif diff --git a/source/application/example_semaphore/example_semaphore.mk b/source/application/example_semaphore/example_semaphore.mk deleted file mode 100755 index 5658595..0000000 --- a/source/application/example_semaphore/example_semaphore.mk +++ /dev/null @@ -1,4 +0,0 @@ -CHECK_FOLDER += application/example_semaphore -SUB_FOLDER += application/example_semaphore -INCLUDES += application/example_semaphore -DOC_SRC += application/example_semaphore diff --git a/source/application/example_semaphore/main.c b/source/application/example_semaphore/main.c deleted file mode 100644 index bf03045..0000000 --- a/source/application/example_semaphore/main.c +++ /dev/null @@ -1,51 +0,0 @@ -#include - -#include "board.h" -#include "ctx.h" -#include "stack.h" -#include "queue.h" -#include "thread.h" -#include "schedule.h" -#include "isr.h" -#include "sys_tick.h" -#include "semaphore.h" - -#define STACK_SIZE 256 -static stack_t tc_1_stack[STACK_SIZE]; -static struct thread_context tc_1; -static stack_t tc_2_stack[STACK_SIZE]; -static struct thread_context tc_2; - -static struct semaphore sem; - -void task2(void *arg) -{ - gpio_open(&led_1); - gpio_write(&led_1, 0); - while(1) { - semaphore_wait(&sem); - gpio_toggle(&led_1); - } -} - -void task1(void *arg) -{ - while(1) { - sleep_ms(3000); - semaphore_post(&sem); - } -} - -int main(void) -{ - board_init(); - sys_tick_init(&timer_1); - - semaphore_init( &sem, 0); - - thread_create(&tc_1, tc_1_stack, STACK_SIZE, task1, NULL, THREAD_PRIO_LOW); - thread_create(&tc_2, tc_2_stack, STACK_SIZE, task2, NULL, THREAD_PRIO_LOW); - schedule_start(); - - return 0; -} diff --git a/source/application/test/main.c b/source/application/main.c similarity index 100% rename from source/application/test/main.c rename to source/application/main.c diff --git a/source/application/test/test.mk b/source/application/test/test.mk deleted file mode 100755 index ca3a7a2..0000000 --- a/source/application/test/test.mk +++ /dev/null @@ -1,4 +0,0 @@ -CHECK_FOLDER += application/test -SUB_FOLDER += application/test -INCLUDES += application/test -DOC_SRC += application/test