aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/platforms/SPC5xx
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-11-21 13:47:59 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-11-21 13:47:59 +0000
commit57618ff11dd6e4539ef46f36599db48a40cbb181 (patch)
treefb7ab58d1ef043bb2cd94d8adc9fbd61efa8121c /os/hal/platforms/SPC5xx
parent24c823f54822a2abc01a9d4e6f6dcf9c31a4e8e3 (diff)
downloadChibiOS-57618ff11dd6e4539ef46f36599db48a40cbb181.tar.gz
ChibiOS-57618ff11dd6e4539ef46f36599db48a40cbb181.tar.bz2
ChibiOS-57618ff11dd6e4539ef46f36599db48a40cbb181.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4835 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/SPC5xx')
-rw-r--r--os/hal/platforms/SPC5xx/SIUL_v1/pal_lld.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/os/hal/platforms/SPC5xx/SIUL_v1/pal_lld.c b/os/hal/platforms/SPC5xx/SIUL_v1/pal_lld.c
index e098391ce..ec0b576e9 100644
--- a/os/hal/platforms/SPC5xx/SIUL_v1/pal_lld.c
+++ b/os/hal/platforms/SPC5xx/SIUL_v1/pal_lld.c
@@ -43,6 +43,10 @@
/* Driver local variables. */
/*===========================================================================*/
+#if defined(SPC5_SIU_SYSTEM_PINS)
+static const unsigned system_pins[] = {SPC5_SIU_SYSTEM_PINS};
+#endif
+
/*===========================================================================*/
/* Driver local functions. */
/*===========================================================================*/
@@ -72,8 +76,22 @@ void _pal_lld_init(const PALConfig *config) {
#endif
/* Initialize PCR registers for undefined pads.*/
- for (i = 0; i < SPC5_SIU_NUM_PCRS; i++)
+ for (i = 0; i < SPC5_SIU_NUM_PCRS; i++) {
+#if defined(SPC5_SIU_SYSTEM_PINS)
+ /* Handling the case where some SIU pins are not meant to be reprogrammed,
+ for example JTAG pins.*/
+ unsigned j;
+ for (j = 0; j < sizeof system_pins; j++) {
+ if (i == system_pins[j])
+ goto skip;
+ }
+ SIU.PCR[i].R = config->default_mode;
+skip:
+ ;
+#else
SIU.PCR[i].R = config->default_mode;
+#endif
+ }
/* Initialize PADSEL registers.*/
for (i = 0; i < SPC5_SIU_NUM_PADSELS; i++)