From 93fc8b57778f698cbe7e0e202e33b5d56ce09039 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 8 Dec 2009 10:36:29 +0000 Subject: HAL implemented for LPC214x. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1392 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARM7-LPC214x-G++/Makefile | 13 ++--- demos/ARM7-LPC214x-G++/board.c | 78 ++------------------------ demos/ARM7-LPC214x-G++/board.h | 4 -- demos/ARM7-LPC214x-G++/halconf.h | 96 ++++++++++++++++++++++++++++++++ demos/ARM7-LPC214x-G++/main.cpp | 11 ++-- demos/ARM7-LPC214x-GCC-minimal/Makefile | 11 ++-- demos/ARM7-LPC214x-GCC-minimal/board.c | 78 ++------------------------ demos/ARM7-LPC214x-GCC-minimal/board.h | 4 -- demos/ARM7-LPC214x-GCC-minimal/halconf.h | 96 ++++++++++++++++++++++++++++++++ demos/ARM7-LPC214x-GCC-minimal/main.c | 6 +- demos/ARM7-LPC214x-GCC/halconf.h | 96 ++++++++++++++++++++++++++++++++ os/hal/platforms/AT91SAM7/serial_lld.c | 2 +- os/hal/platforms/AT91SAM7/serial_lld.h | 2 +- os/hal/platforms/LPC214x/pal_lld.c | 4 ++ os/hal/platforms/LPC214x/pal_lld.h | 4 ++ os/hal/platforms/LPC214x/serial_lld.c | 4 ++ os/hal/platforms/LPC214x/serial_lld.h | 4 ++ 17 files changed, 334 insertions(+), 179 deletions(-) create mode 100644 demos/ARM7-LPC214x-G++/halconf.h create mode 100644 demos/ARM7-LPC214x-GCC-minimal/halconf.h create mode 100644 demos/ARM7-LPC214x-GCC/halconf.h diff --git a/demos/ARM7-LPC214x-G++/Makefile b/demos/ARM7-LPC214x-G++/Makefile index 3bb33abfe..8c20ec2b8 100644 --- a/demos/ARM7-LPC214x-G++/Makefile +++ b/demos/ARM7-LPC214x-G++/Makefile @@ -44,6 +44,8 @@ LDSCRIPT = ch.ld # Imported source files CHIBIOS = ../.. +include ${CHIBIOS}/os/hal/hal.mk +include ${CHIBIOS}/os/hal/platforms/LPC214x/platform.mk include ${CHIBIOS}/os/ports/GCC/ARM7/port.mk include ${CHIBIOS}/os/kernel/kernel.mk include ${CHIBIOS}/test/test.mk @@ -53,11 +55,8 @@ include ${CHIBIOS}/test/test.mk CSRC = ${PORTSRC} \ ${KERNSRC} \ ${TESTSRC} \ - ${CHIBIOS}/os/io/pal.c \ - ${CHIBIOS}/os/io/serial.c \ - ${CHIBIOS}/os/io/platforms/LPC214x/pal_lld.c \ - ${CHIBIOS}/os/io/platforms/LPC214x/serial_lld.c \ - ${CHIBIOS}/os/io/platforms/LPC214x/vic.c \ + ${HALSRC} \ + ${PLATFORMSRC} \ ${CHIBIOS}/os/various/evtimer.c \ board.c @@ -89,9 +88,7 @@ TCPPSRC = ASMSRC = $(PORTASM) \ ${CHIBIOS}/os/ports/GCC/ARM7/LPC214x/vectors.s -INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \ - ${CHIBIOS}/os/io \ - ${CHIBIOS}/os/io/platforms/LPC214x \ +INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) $(HALINC) $(PLATFORMINC) \ ${CHIBIOS}/os/various \ ${CHIBIOS}/os/ports/GCC/ARM7/LPC214x diff --git a/demos/ARM7-LPC214x-G++/board.c b/demos/ARM7-LPC214x-G++/board.c index eba3f59e3..539adabee 100644 --- a/demos/ARM7-LPC214x-G++/board.c +++ b/demos/ARM7-LPC214x-G++/board.c @@ -17,30 +17,14 @@ along with this program. If not, see . */ -#include -#include -#include +#include "ch.h" +#include "hal.h" -#include "lpc214x.h" -#include "vic.h" //#include "lpc214x_ssp.h" - -#include "board.h" //#include "mmcsd.h" //#include "buzzer.h" -/* - * Non-vectored IRQs handling here. - */ -static CH_IRQ_HANDLER(IrqHandler) { - - CH_IRQ_PROLOGUE(); - - /* nothing */ - - VICVectAddr = 0; - CH_IRQ_EPILOGUE(); -} +#define VAL_TC0_PRESCALER 0 /* * Timer 0 IRQ handling here. @@ -58,18 +42,6 @@ static CH_IRQ_HANDLER(T0IrqHandler) { CH_IRQ_EPILOGUE(); } -/* - * Digital I/O ports static configuration as defined in @p board.h. - */ -static const LPC214xFIOConfig config = -{ - VAL_PINSEL0, - VAL_PINSEL1, - VAL_PINSEL2, - {VAL_FIO0PIN, VAL_FIO0DIR}, - {VAL_FIO1PIN, VAL_FIO1DIR} -}; - /* * Early initialization code. * This initialization is performed just after reset before BSS and DATA @@ -77,43 +49,7 @@ static const LPC214xFIOConfig config = */ void hwinit0(void) { - /* - * All peripherals clock disabled by default in order to save power. - */ - PCONP = PCRTC | PCTIM0; - - /* - * MAM setup. - */ - MAMTIM = 0x3; /* 3 cycles for flash accesses. */ - MAMCR = 0x2; /* MAM fully enabled. */ - - /* - * PLL setup for Fosc=12MHz and CCLK=48MHz. - * P=2 M=3. - */ - PLL *pll = PLL0Base; - pll->PLL_CFG = 0x23; /* P and M values. */ - pll->PLL_CON = 0x1; /* Enables the PLL 0. */ - pll->PLL_FEED = 0xAA; - pll->PLL_FEED = 0x55; - while (!(pll->PLL_STAT & 0x400)) - ; /* Wait for PLL lock. */ - - pll->PLL_CON = 0x3; /* Connects the PLL. */ - pll->PLL_FEED = 0xAA; - pll->PLL_FEED = 0x55; - - /* - * VPB setup. - * PCLK = CCLK / 4. - */ - VPBDIV = VPD_D4; - - /* - * I/O pins configuration. - */ - palInit(&config); + lpc214x_clock_init(); } /* @@ -124,10 +60,9 @@ void hwinit0(void) { void hwinit1(void) { /* - * Interrupt vectors assignment. + * HAL initialization. */ - vic_init(); - VICDefVectAddr = (IOREG32)IrqHandler; + halInit(); /* * System Timer initialization, 1ms intervals. @@ -144,7 +79,6 @@ void hwinit1(void) { /* * Other subsystems. */ - sdInit(); // ssp_init(); // InitMMC(); // InitBuzzer(); diff --git a/demos/ARM7-LPC214x-G++/board.h b/demos/ARM7-LPC214x-G++/board.h index 022383032..b66ce235d 100644 --- a/demos/ARM7-LPC214x-G++/board.h +++ b/demos/ARM7-LPC214x-G++/board.h @@ -20,8 +20,6 @@ #ifndef _BOARD_H_ #define _BOARD_H_ -#include "lpc214x.h" - #define BOARD_OLIMEX_LCP_P2148 /* @@ -32,8 +30,6 @@ #define CCLK 48000000 #define PCLK 12000000 -#define VAL_TC0_PRESCALER 0 - /* * Pins configuration for Olimex LPC-P2148. * diff --git a/demos/ARM7-LPC214x-G++/halconf.h b/demos/ARM7-LPC214x-G++/halconf.h new file mode 100644 index 000000000..4e2e694c4 --- /dev/null +++ b/demos/ARM7-LPC214x-G++/halconf.h @@ -0,0 +1,96 @@ +/* + ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @addtogroup HAL_CONF + * @{ + */ + +/* + * HAL configuration file, this file allows to enable or disable the various + * device drivers from your application. You may also use this file in order + * to change the device drivers settings found in the low level drivers + * headers, just define here the new settings and those will override the + * defaults defined in the LLD headers. + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) +#define CH_HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) +#define CH_HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) +#define CH_HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) +#define CH_HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) +#define CH_HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define CH_HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) +#define CH_HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define CH_HAL_USE_MMC_SPI FALSE +#endif + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/demos/ARM7-LPC214x-G++/main.cpp b/demos/ARM7-LPC214x-G++/main.cpp index f0268045d..7b012d004 100644 --- a/demos/ARM7-LPC214x-G++/main.cpp +++ b/demos/ARM7-LPC214x-G++/main.cpp @@ -17,13 +17,10 @@ along with this program. If not, see . */ -#include -#include -#include -#include -#include - -#include "board.h" +#include "ch.hpp" +#include "hal.h" +#include "test.h" +#include "evtimer.h" #define BOTH_BUTTONS (PAL_PORT_BIT(PA_BUTTON1) | PAL_PORT_BIT(PA_BUTTON2)) diff --git a/demos/ARM7-LPC214x-GCC-minimal/Makefile b/demos/ARM7-LPC214x-GCC-minimal/Makefile index 21e9a0eea..8801183e4 100644 --- a/demos/ARM7-LPC214x-GCC-minimal/Makefile +++ b/demos/ARM7-LPC214x-GCC-minimal/Makefile @@ -44,6 +44,8 @@ LDSCRIPT = ch.ld # Imported source files CHIBIOS = ../.. +include ${CHIBIOS}/os/hal/hal.mk +include ${CHIBIOS}/os/hal/platforms/LPC214x/platform.mk include ${CHIBIOS}/os/ports/GCC/ARM7/port.mk include ${CHIBIOS}/os/kernel/kernel.mk #include ${CHIBIOS}/test/test.mk @@ -53,9 +55,8 @@ include ${CHIBIOS}/os/kernel/kernel.mk CSRC = ${PORTSRC} \ ${KERNSRC} \ ${TESTSRC} \ - ${CHIBIOS}/os/io/pal.c \ - ${CHIBIOS}/os/io/platforms/LPC214x/pal_lld.c \ - ${CHIBIOS}/os/io/platforms/LPC214x/vic.c \ + ${HALSRC} \ + ${PLATFORMSRC} \ board.c main.c # C++ sources that can be compiled in ARM or THUMB mode depending on the global @@ -86,9 +87,7 @@ TCPPSRC = ASMSRC = $(PORTASM) \ ${CHIBIOS}/os/ports/GCC/ARM7/LPC214x/vectors.s -INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \ - ${CHIBIOS}/os/io \ - ${CHIBIOS}/os/io/platforms/LPC214x \ +INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) $(HALINC) $(PLATFORMINC) \ ${CHIBIOS}/os/various \ ${CHIBIOS}/os/ports/GCC/ARM7/LPC214x diff --git a/demos/ARM7-LPC214x-GCC-minimal/board.c b/demos/ARM7-LPC214x-GCC-minimal/board.c index bcf430ade..539adabee 100644 --- a/demos/ARM7-LPC214x-GCC-minimal/board.c +++ b/demos/ARM7-LPC214x-GCC-minimal/board.c @@ -17,30 +17,14 @@ along with this program. If not, see . */ -#include -#include +#include "ch.h" +#include "hal.h" -#include "lpc214x.h" -#include "vic.h" -//#include "lpc214x_serial.h" //#include "lpc214x_ssp.h" - -#include "board.h" //#include "mmcsd.h" //#include "buzzer.h" -/* - * Non-vectored IRQs handling here. - */ -static CH_IRQ_HANDLER(IrqHandler) { - - CH_IRQ_PROLOGUE(); - - /* nothing */ - - VICVectAddr = 0; - CH_IRQ_EPILOGUE(); -} +#define VAL_TC0_PRESCALER 0 /* * Timer 0 IRQ handling here. @@ -58,18 +42,6 @@ static CH_IRQ_HANDLER(T0IrqHandler) { CH_IRQ_EPILOGUE(); } -/* - * Digital I/O ports static configuration as defined in @p board.h. - */ -static const LPC214xFIOConfig config = -{ - VAL_PINSEL0, - VAL_PINSEL1, - VAL_PINSEL2, - {VAL_FIO0PIN, VAL_FIO0DIR}, - {VAL_FIO1PIN, VAL_FIO1DIR} -}; - /* * Early initialization code. * This initialization is performed just after reset before BSS and DATA @@ -77,43 +49,7 @@ static const LPC214xFIOConfig config = */ void hwinit0(void) { - /* - * All peripherals clock disabled by default in order to save power. - */ - PCONP = PCRTC | PCTIM0; - - /* - * MAM setup. - */ - MAMTIM = 0x3; /* 3 cycles for flash accesses. */ - MAMCR = 0x2; /* MAM fully enabled. */ - - /* - * PLL setup for Fosc=12MHz and CCLK=48MHz. - * P=2 M=3. - */ - PLL *pll = PLL0Base; - pll->PLL_CFG = 0x23; /* P and M values. */ - pll->PLL_CON = 0x1; /* Enables the PLL 0. */ - pll->PLL_FEED = 0xAA; - pll->PLL_FEED = 0x55; - while (!(pll->PLL_STAT & 0x400)) - ; /* Wait for PLL lock. */ - - pll->PLL_CON = 0x3; /* Connects the PLL. */ - pll->PLL_FEED = 0xAA; - pll->PLL_FEED = 0x55; - - /* - * VPB setup. - * PCLK = CCLK / 4. - */ - VPBDIV = VPD_D4; - - /* - * I/O pins configuration. - */ - palInit(&config); + lpc214x_clock_init(); } /* @@ -124,10 +60,9 @@ void hwinit0(void) { void hwinit1(void) { /* - * Interrupt vectors assignment. + * HAL initialization. */ - vic_init(); - VICDefVectAddr = (IOREG32)IrqHandler; + halInit(); /* * System Timer initialization, 1ms intervals. @@ -144,7 +79,6 @@ void hwinit1(void) { /* * Other subsystems. */ -// sdInit(); // ssp_init(); // InitMMC(); // InitBuzzer(); diff --git a/demos/ARM7-LPC214x-GCC-minimal/board.h b/demos/ARM7-LPC214x-GCC-minimal/board.h index 022383032..b66ce235d 100644 --- a/demos/ARM7-LPC214x-GCC-minimal/board.h +++ b/demos/ARM7-LPC214x-GCC-minimal/board.h @@ -20,8 +20,6 @@ #ifndef _BOARD_H_ #define _BOARD_H_ -#include "lpc214x.h" - #define BOARD_OLIMEX_LCP_P2148 /* @@ -32,8 +30,6 @@ #define CCLK 48000000 #define PCLK 12000000 -#define VAL_TC0_PRESCALER 0 - /* * Pins configuration for Olimex LPC-P2148. * diff --git a/demos/ARM7-LPC214x-GCC-minimal/halconf.h b/demos/ARM7-LPC214x-GCC-minimal/halconf.h new file mode 100644 index 000000000..63afdace0 --- /dev/null +++ b/demos/ARM7-LPC214x-GCC-minimal/halconf.h @@ -0,0 +1,96 @@ +/* + ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @addtogroup HAL_CONF + * @{ + */ + +/* + * HAL configuration file, this file allows to enable or disable the various + * device drivers from your application. You may also use this file in order + * to change the device drivers settings found in the low level drivers + * headers, just define here the new settings and those will override the + * defaults defined in the LLD headers. + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) +#define CH_HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) +#define CH_HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) +#define CH_HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) +#define CH_HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) +#define CH_HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define CH_HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) +#define CH_HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define CH_HAL_USE_MMC_SPI FALSE +#endif + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/demos/ARM7-LPC214x-GCC-minimal/main.c b/demos/ARM7-LPC214x-GCC-minimal/main.c index 7ce5ffe95..940e77b5e 100644 --- a/demos/ARM7-LPC214x-GCC-minimal/main.c +++ b/demos/ARM7-LPC214x-GCC-minimal/main.c @@ -17,10 +17,8 @@ along with this program. If not, see . */ -#include -#include - -#include "board.h" +#include "ch.h" +#include "hal.h" /* * Red LEDs blinker thread, times are in milliseconds. diff --git a/demos/ARM7-LPC214x-GCC/halconf.h b/demos/ARM7-LPC214x-GCC/halconf.h new file mode 100644 index 000000000..4e2e694c4 --- /dev/null +++ b/demos/ARM7-LPC214x-GCC/halconf.h @@ -0,0 +1,96 @@ +/* + ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @addtogroup HAL_CONF + * @{ + */ + +/* + * HAL configuration file, this file allows to enable or disable the various + * device drivers from your application. You may also use this file in order + * to change the device drivers settings found in the low level drivers + * headers, just define here the new settings and those will override the + * defaults defined in the LLD headers. + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(CH_HAL_USE_PAL) || defined(__DOXYGEN__) +#define CH_HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(CH_HAL_USE_ADC) || defined(__DOXYGEN__) +#define CH_HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(CH_HAL_USE_CAN) || defined(__DOXYGEN__) +#define CH_HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(CH_HAL_USE_MAC) || defined(__DOXYGEN__) +#define CH_HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(CH_HAL_USE_PWM) || defined(__DOXYGEN__) +#define CH_HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(CH_HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define CH_HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(CH_HAL_USE_SPI) || defined(__DOXYGEN__) +#define CH_HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(CH_HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define CH_HAL_USE_MMC_SPI FALSE +#endif + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/os/hal/platforms/AT91SAM7/serial_lld.c b/os/hal/platforms/AT91SAM7/serial_lld.c index 1304aadb0..1673fb7e2 100644 --- a/os/hal/platforms/AT91SAM7/serial_lld.c +++ b/os/hal/platforms/AT91SAM7/serial_lld.c @@ -294,6 +294,6 @@ void sd_lld_stop(SerialDriver *sdp) { #endif } -#endif /* CH_HAL_USE_SPI */ +#endif /* CH_HAL_USE_SERIAL */ /** @} */ diff --git a/os/hal/platforms/AT91SAM7/serial_lld.h b/os/hal/platforms/AT91SAM7/serial_lld.h index 9dc4bf8bf..1e6216b29 100644 --- a/os/hal/platforms/AT91SAM7/serial_lld.h +++ b/os/hal/platforms/AT91SAM7/serial_lld.h @@ -154,7 +154,7 @@ extern "C" { #endif /** @endcond*/ -#endif /* CH_HAL_USE_SPI */ +#endif /* CH_HAL_USE_SERIAL */ #endif /* _SERIAL_LLD_H_ */ diff --git a/os/hal/platforms/LPC214x/pal_lld.c b/os/hal/platforms/LPC214x/pal_lld.c index 5a024fff8..8e4481db0 100644 --- a/os/hal/platforms/LPC214x/pal_lld.c +++ b/os/hal/platforms/LPC214x/pal_lld.c @@ -27,6 +27,8 @@ #include "ch.h" #include "hal.h" +#if CH_HAL_USE_PAL || defined(__DOXYGEN__) + /** * @brief LPC214x I/O ports configuration. * @details FIO units and PINSEL registers initialization. @@ -86,4 +88,6 @@ void _pal_lld_setgroupmode(ioportid_t port, } } +#endif /* CH_HAL_USE_PAL */ + /** @} */ diff --git a/os/hal/platforms/LPC214x/pal_lld.h b/os/hal/platforms/LPC214x/pal_lld.h index f007abda8..c89c98504 100644 --- a/os/hal/platforms/LPC214x/pal_lld.h +++ b/os/hal/platforms/LPC214x/pal_lld.h @@ -27,6 +27,8 @@ #ifndef _PAL_LLD_H_ #define _PAL_LLD_H_ +#if CH_HAL_USE_PAL || defined(__DOXYGEN__) + /*===========================================================================*/ /* Unsupported modes and specific modes */ /*===========================================================================*/ @@ -248,6 +250,8 @@ extern "C" { } #endif +#endif /* CH_HAL_USE_PAL */ + #endif /* _PAL_LLD_H_ */ /** @} */ diff --git a/os/hal/platforms/LPC214x/serial_lld.c b/os/hal/platforms/LPC214x/serial_lld.c index e7ccc6dd0..970e0c6cd 100644 --- a/os/hal/platforms/LPC214x/serial_lld.c +++ b/os/hal/platforms/LPC214x/serial_lld.c @@ -27,6 +27,8 @@ #include "ch.h" #include "hal.h" +#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__) + #if USE_LPC214x_UART0 || defined(__DOXYGEN__) /** @brief UART0 serial driver identifier.*/ SerialDriver SD1; @@ -331,4 +333,6 @@ void sd_lld_stop(SerialDriver *sdp) { #endif } +#endif /* CH_HAL_USE_SERIAL */ + /** @} */ diff --git a/os/hal/platforms/LPC214x/serial_lld.h b/os/hal/platforms/LPC214x/serial_lld.h index b6ac8e379..4bfc97bc5 100644 --- a/os/hal/platforms/LPC214x/serial_lld.h +++ b/os/hal/platforms/LPC214x/serial_lld.h @@ -27,6 +27,8 @@ #ifndef _SERIAL_LLD_H_ #define _SERIAL_LLD_H_ +#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__) + /*===========================================================================*/ /* Driver pre-compile time settings. */ /*===========================================================================*/ @@ -169,6 +171,8 @@ extern "C" { #endif /** @endcond*/ +#endif /* CH_HAL_USE_SERIAL */ + #endif /* _SERIAL_LLD_H_ */ /** @} */ -- cgit v1.2.3