From 18d53779c4fef3efca606aead2da3af40ec76332 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Thu, 27 Jan 2011 20:07:13 +0100 Subject: FreeRTOS now boots and run properly. Yay! --- arch/arm/lpc17xx/hooks.c | 4 ++-- arch/arm/lpc17xx/startup.s | 25 +++---------------------- config/target.mk | 2 +- demo.c | 27 +++++++++++++++++++++++---- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/arch/arm/lpc17xx/hooks.c b/arch/arm/lpc17xx/hooks.c index 5aeb335..e68c74a 100644 --- a/arch/arm/lpc17xx/hooks.c +++ b/arch/arm/lpc17xx/hooks.c @@ -7,7 +7,7 @@ void vConfigureTimerForRunTimeStats() { } void vApplicationTickHook() { - DBGOUT("vApplicationTickHook()\r\n"); +// DBGOUT("vApplicationTickHook()\r\n"); } void vApplicationStackOverflowHook(xTaskHandle *pxTask, signed portCHAR *pcTaskName) { @@ -15,5 +15,5 @@ void vApplicationStackOverflowHook(xTaskHandle *pxTask, signed portCHAR *pcTaskN } void vApplicationIdleHook() { - DBGOUT("vApplicationIdleHook()\r\n"); +// DBGOUT("vApplicationIdleHook()\r\n"); } diff --git a/arch/arm/lpc17xx/startup.s b/arch/arm/lpc17xx/startup.s index 2f79741..7b9e56c 100644 --- a/arch/arm/lpc17xx/startup.s +++ b/arch/arm/lpc17xx/startup.s @@ -71,11 +71,11 @@ __cs3_interrupt_vector_cortex_m: .long 0 /* Reserved */ .long 0 /* Reserved */ .long 0 /* Reserved */ - .long SVC_Handler /* SVCall Handler */ + .long vPortSVCHandler /* SVCall Handler */ .long DebugMon_Handler /* Debug Monitor Handler */ .long 0 /* Reserved */ - .long PendSV_Handler /* PendSV Handler */ - .long SysTick_Handler /* SysTick Handler */ + .long xPortPendSVHandler /* PendSV Handler */ + .long xPortSysTickHandler /* SysTick Handler */ /* External Interrupts */ .long WDT_IRQHandler /* 16: Watchdog Timer */ @@ -190,13 +190,6 @@ __cs3_reset_cortex_m: .section ".privileged_code" -/* Exception Handlers */ - - .weak SVC_Handler - .type SVC_Handler, %function -SVC_Handler: - B . - .size SVC_Handler, . - SVC_Handler .weak DebugMon_Handler .type DebugMon_Handler, %function @@ -204,18 +197,6 @@ DebugMon_Handler: B . .size DebugMon_Handler, . - DebugMon_Handler - .weak PendSV_Handler - .type PendSV_Handler, %function -PendSV_Handler: - B . - .size PendSV_Handler, . - PendSV_Handler - - .weak SysTick_Handler - .type SysTick_Handler, %function -SysTick_Handler: - B . - .size SysTick_Handler, . - SysTick_Handler - /* IRQ Handlers */ diff --git a/config/target.mk b/config/target.mk index 2b3a3a2..7ba3d0a 100644 --- a/config/target.mk +++ b/config/target.mk @@ -1,5 +1,5 @@ export BOARD = mbed -export USE_MPU = true +export USE_MPU = false ifeq ($(BOARD),mbed) diff --git a/demo.c b/demo.c index c3df902..c06fba1 100644 --- a/demo.c +++ b/demo.c @@ -2,6 +2,7 @@ #include #include #include +#include #define LED1_wire 18 #define LED2_wire 20 @@ -12,7 +13,7 @@ static void setupLEDs() { GPIO_SetDir(1, (1 << LED1_wire) | (1 << LED2_wire) | (1 << LED3_wire) | (1 << LED4_wire), 1); } -void litLED(int led, int value) { +static void litLED(int led, int value) { if ((led > 4) || (led < 0)) return; @@ -30,13 +31,31 @@ void litLED(int led, int value) { } } +static void simpleTask1(void *p) { + while (1) { + BoardConsolePuts("Task 1"); + vTaskDelay(1234); + } +} + +static void simpleTask2(void *p) { + while (1) { + BoardConsolePuts("Task 2"); + vTaskDelay(1357); + } +} + int main() { setupLEDs(); - litLED(1, 1); + litLED(1, 0); litLED(2, 0); - litLED(3, 1); + litLED(3, 0); litLED(4, 0); - BoardConsolePuts("Hello World."); + BoardConsolePuts("Creating simple tasks."); + xTaskCreate(simpleTask1, (signed char *) "st1", configMINIMAL_STACK_SIZE, (void *)NULL, tskIDLE_PRIORITY | portPRIVILEGE_BIT, NULL); + xTaskCreate(simpleTask2, (signed char *) "st2", configMINIMAL_STACK_SIZE, (void *)NULL, tskIDLE_PRIORITY | portPRIVILEGE_BIT, NULL); + BoardConsolePuts("Scheduler starting."); vTaskStartScheduler(); + BoardConsolePuts("Scheduler exitting."); return 0; } -- cgit v1.2.3