From 653c72ccc3c8ff29bb2f2cffa00d1898c96c8ecf Mon Sep 17 00:00:00 2001 From: Fabio Utzig Date: Mon, 4 Apr 2016 21:35:11 -0300 Subject: Fix tiva demos --- demos/TIVA/RT-TM4C1294-LAUNCHPAD/Makefile | 7 +++---- demos/TIVA/RT-TM4C1294-LAUNCHPAD/chconf.h | 25 +++++++++++++++++++++++++ demos/TIVA/RT-TM4C1294-LAUNCHPAD/main.c | 11 ++++------- 3 files changed, 32 insertions(+), 11 deletions(-) (limited to 'demos/TIVA/RT-TM4C1294-LAUNCHPAD') diff --git a/demos/TIVA/RT-TM4C1294-LAUNCHPAD/Makefile b/demos/TIVA/RT-TM4C1294-LAUNCHPAD/Makefile index 08aace6..344d3e8 100644 --- a/demos/TIVA/RT-TM4C1294-LAUNCHPAD/Makefile +++ b/demos/TIVA/RT-TM4C1294-LAUNCHPAD/Makefile @@ -83,7 +83,7 @@ PROJECT = ch CHIBIOS = ../../../../ChibiOS-RT CHIBIOS_CONTRIB = $(CHIBIOS)/../ChibiOS-Contrib # Startup files. -include $(CHIBIOS_CONTRIB)/os/common/ports/ARMCMx/compilers/GCC/mk/startup_tm4c129x.mk +include $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_tm4c129x.mk # HAL-OSAL files (optional). include $(CHIBIOS)/os/hal/hal.mk include $(CHIBIOS_CONTRIB)/os/hal/ports/TIVA/TM4C129x/platform.mk @@ -91,7 +91,7 @@ include $(CHIBIOS_CONTRIB)/os/hal/boards/TI_TM4C1294_LAUNCHPAD/board.mk include $(CHIBIOS)/os/hal/osal/rt/osal.mk # RTOS files (optional). include $(CHIBIOS)/os/rt/rt.mk -include $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk +include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk # Other files (optional). include $(CHIBIOS)/test/rt/test.mk @@ -151,7 +151,6 @@ INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ MCU = cortex-m4 -#TRGT = arm-elf- TRGT = arm-none-eabi- CC = $(TRGT)gcc CPPC = $(TRGT)g++ @@ -207,5 +206,5 @@ ULIBS = # End of user defines ############################################################################## -RULESPATH = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC +RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC include $(RULESPATH)/rules.mk diff --git a/demos/TIVA/RT-TM4C1294-LAUNCHPAD/chconf.h b/demos/TIVA/RT-TM4C1294-LAUNCHPAD/chconf.h index aac875a..e99b5b3 100644 --- a/demos/TIVA/RT-TM4C1294-LAUNCHPAD/chconf.h +++ b/demos/TIVA/RT-TM4C1294-LAUNCHPAD/chconf.h @@ -1,6 +1,8 @@ #ifndef _CHCONF_H_ #define _CHCONF_H_ +#define _CHIBIOS_RT_CONF_ + /*===========================================================================*/ /** * @name System timers settings @@ -413,6 +415,20 @@ /* System halt code here.*/ \ } +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + /** * @brief Idle thread enter hook. * @note This hook is invoked within a critical zone, no OS functions @@ -457,6 +473,15 @@ /* System halt code here.*/ \ } +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + /** @} */ /*===========================================================================*/ diff --git a/demos/TIVA/RT-TM4C1294-LAUNCHPAD/main.c b/demos/TIVA/RT-TM4C1294-LAUNCHPAD/main.c index bb2b0e3..adb915e 100644 --- a/demos/TIVA/RT-TM4C1294-LAUNCHPAD/main.c +++ b/demos/TIVA/RT-TM4C1294-LAUNCHPAD/main.c @@ -16,7 +16,7 @@ #include "ch.h" #include "hal.h" -#include "test.h" +#include "ch_test.h" typedef struct led_config { @@ -32,8 +32,7 @@ static THD_WORKING_AREA(waBlinkLed1, 128); static THD_WORKING_AREA(waBlinkLed2, 128); static THD_WORKING_AREA(waBlinkLed3, 128); static THD_WORKING_AREA(waBlinkLed4, 128); -static msg_t blinkLed(void *arg) -{ +static THD_FUNCTION(blinkLed, arg) { led_config_t *ledConfig = (led_config_t*) arg; chRegSetThreadName("Blinker"); @@ -45,8 +44,6 @@ static msg_t blinkLed(void *arg) chThdSleepMilliseconds(ledConfig->sleep); palTogglePad(ledConfig->port, ledConfig->pin); } - - return (msg_t) 0; } /* @@ -74,7 +71,7 @@ int main(void) sdStart(&SD1, NULL); if (!palReadPad(GPIOJ, GPIOJ_SW1)) { - TestThread(&SD1); + test_execute((BaseSequentialStream *)&SD1); } led1.port = GPIOF; @@ -112,6 +109,6 @@ int main(void) while (TRUE) { chThdSleepMilliseconds(100); } - + return 0; } -- cgit v1.2.3