From 9a584b8672a00b096ee20e9cd63a0f605056a055 Mon Sep 17 00:00:00 2001 From: Steven Cooreman Date: Sat, 22 Oct 2016 16:57:51 +0200 Subject: [PATCH] Clean up per-target Modules.h Removed deprecated defines MODULES_SIZE_* and moved the setting for the SPI asynch transfer queue size to targets.json, where it apparently belongs --- .../TARGET_EFM32GG_STK3700/Modules.h | 35 ------------------- .../TARGET_EFM32HG_STK3400/Modules.h | 35 ------------------- .../TARGET_EFM32LG_STK3600/Modules.h | 35 ------------------- .../TARGET_EFM32PG_STK3401/Modules.h | 35 ------------------- .../TARGET_EFM32WG_STK3800/Modules.h | 35 ------------------- .../TARGET_EFM32ZG_STK3200/Modules.h | 35 ------------------- .../TARGET_EFM32/serial_api.c | 12 +++++++ targets/targets.json | 12 +++---- 8 files changed, 18 insertions(+), 216 deletions(-) delete mode 100644 targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG_STK3700/Modules.h delete mode 100644 targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32HG_STK3400/Modules.h delete mode 100644 targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32LG_STK3600/Modules.h delete mode 100644 targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32PG_STK3401/Modules.h delete mode 100644 targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32WG_STK3800/Modules.h delete mode 100644 targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32ZG_STK3200/Modules.h diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG_STK3700/Modules.h b/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG_STK3700/Modules.h deleted file mode 100644 index f7e3f88fa4..0000000000 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG_STK3700/Modules.h +++ /dev/null @@ -1,35 +0,0 @@ -/***************************************************************************//** - * @file Modules.h - ******************************************************************************* - * @section License - * (C) Copyright 2015 Silicon Labs, http://www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ -#ifndef MBED_MODULES_H -#define MBED_MODULES_H - -#define MODULES_SIZE_ANALOGIN 1 -#define MODULES_SIZE_ANALOGOUT 1 -#define MODULES_SIZE_GPIO 1 -#define MODULES_SIZE_SPI 3 -#define MODULES_SIZE_I2C 2 -#define MODULES_SIZE_PWMOUT 1 -#define MODULES_SIZE_SERIAL 7 -#define TRANSACTION_QUEUE_SIZE_SPI 4 - -#endif diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32HG_STK3400/Modules.h b/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32HG_STK3400/Modules.h deleted file mode 100644 index c95b43ab37..0000000000 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32HG_STK3400/Modules.h +++ /dev/null @@ -1,35 +0,0 @@ -/***************************************************************************//** - * @file Modules.h - ******************************************************************************* - * @section License - * (C) Copyright 2015 Silicon Labs, http://www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ -#ifndef MBED_MODULES_H -#define MBED_MODULES_H - -#define MODULES_SIZE_ANALOGIN 1 -#define MODULES_SIZE_ANALOGOUT 1 -#define MODULES_SIZE_GPIO 1 -#define MODULES_SIZE_SPI 2 -#define MODULES_SIZE_I2C 1 -#define MODULES_SIZE_PWMOUT 1 -#define MODULES_SIZE_SERIAL 3 -#define TRANSACTION_QUEUE_SIZE_SPI 0 - -#endif diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32LG_STK3600/Modules.h b/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32LG_STK3600/Modules.h deleted file mode 100644 index f7e3f88fa4..0000000000 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32LG_STK3600/Modules.h +++ /dev/null @@ -1,35 +0,0 @@ -/***************************************************************************//** - * @file Modules.h - ******************************************************************************* - * @section License - * (C) Copyright 2015 Silicon Labs, http://www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ -#ifndef MBED_MODULES_H -#define MBED_MODULES_H - -#define MODULES_SIZE_ANALOGIN 1 -#define MODULES_SIZE_ANALOGOUT 1 -#define MODULES_SIZE_GPIO 1 -#define MODULES_SIZE_SPI 3 -#define MODULES_SIZE_I2C 2 -#define MODULES_SIZE_PWMOUT 1 -#define MODULES_SIZE_SERIAL 7 -#define TRANSACTION_QUEUE_SIZE_SPI 4 - -#endif diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32PG_STK3401/Modules.h b/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32PG_STK3401/Modules.h deleted file mode 100644 index d105744a50..0000000000 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32PG_STK3401/Modules.h +++ /dev/null @@ -1,35 +0,0 @@ -/***************************************************************************//** - * @file Modules.h - ******************************************************************************* - * @section License - * (C) Copyright 2015 Silicon Labs, http://www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ -#ifndef MBED_MODULES_H -#define MBED_MODULES_H - -#define MODULES_SIZE_ANALOGIN 1 -#define MODULES_SIZE_ANALOGOUT 0 -#define MODULES_SIZE_GPIO 1 -#define MODULES_SIZE_SPI 2 -#define MODULES_SIZE_I2C 1 -#define MODULES_SIZE_PWMOUT 1 -#define MODULES_SIZE_SERIAL 3 -#define TRANSACTION_QUEUE_SIZE_SPI 4 - -#endif diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32WG_STK3800/Modules.h b/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32WG_STK3800/Modules.h deleted file mode 100644 index f7e3f88fa4..0000000000 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32WG_STK3800/Modules.h +++ /dev/null @@ -1,35 +0,0 @@ -/***************************************************************************//** - * @file Modules.h - ******************************************************************************* - * @section License - * (C) Copyright 2015 Silicon Labs, http://www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ -#ifndef MBED_MODULES_H -#define MBED_MODULES_H - -#define MODULES_SIZE_ANALOGIN 1 -#define MODULES_SIZE_ANALOGOUT 1 -#define MODULES_SIZE_GPIO 1 -#define MODULES_SIZE_SPI 3 -#define MODULES_SIZE_I2C 2 -#define MODULES_SIZE_PWMOUT 1 -#define MODULES_SIZE_SERIAL 7 -#define TRANSACTION_QUEUE_SIZE_SPI 4 - -#endif diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32ZG_STK3200/Modules.h b/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32ZG_STK3200/Modules.h deleted file mode 100644 index f7a2c37b65..0000000000 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32ZG_STK3200/Modules.h +++ /dev/null @@ -1,35 +0,0 @@ -/***************************************************************************//** - * @file Modules.h - ******************************************************************************* - * @section License - * (C) Copyright 2015 Silicon Labs, http://www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ -#ifndef MBED_MODULES_H -#define MBED_MODULES_H - -#define MODULES_SIZE_ANALOGIN 1 -#define MODULES_SIZE_ANALOGOUT 0 -#define MODULES_SIZE_GPIO 1 -#define MODULES_SIZE_SPI 1 -#define MODULES_SIZE_I2C 1 -#define MODULES_SIZE_PWMOUT 1 -#define MODULES_SIZE_SERIAL 2 -#define TRANSACTION_QUEUE_SIZE_SPI 0 - -#endif diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/serial_api.c b/targets/TARGET_Silicon_Labs/TARGET_EFM32/serial_api.c index 04f71583e2..0f4201067a 100644 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/serial_api.c +++ b/targets/TARGET_Silicon_Labs/TARGET_EFM32/serial_api.c @@ -61,6 +61,18 @@ #error Undefined number of low energy UARTs (LEUART). #endif +#ifndef UART_PRESENT +#define UART_COUNT (0) +#endif +#ifndef USART_PRESENT +#define USART_COUNT (0) +#endif +#ifndef LEUART_PRESENT +#define LEUART_COUNT (0) +#endif + +#define MODULES_SIZE_SERIAL (UART_COUNT + USART_COUNT + LEUART_COUNT) + /* Store IRQ id for each UART */ static uint32_t serial_irq_ids[MODULES_SIZE_SERIAL] = { 0 }; /* Interrupt handler from mbed common */ diff --git a/targets/targets.json b/targets/targets.json index 4cec6b6523..2c154909a0 100644 --- a/targets/targets.json +++ b/targets/targets.json @@ -1818,7 +1818,7 @@ "EFM32GG_STK3700": { "inherits": ["Target"], "core": "Cortex-M3", - "macros": ["EFM32GG990F1024"], + "macros": ["EFM32GG990F1024", "TRANSACTION_QUEUE_SIZE_SPI=4"], "extra_labels": ["Silicon_Labs", "EFM32"], "supported_toolchains": ["GCC_ARM", "ARM", "uARM", "IAR"], "progen": {"target": "efm32gg-stk"}, @@ -1830,7 +1830,7 @@ "EFM32LG_STK3600": { "inherits": ["Target"], "core": "Cortex-M3", - "macros": ["EFM32LG990F256"], + "macros": ["EFM32LG990F256", "TRANSACTION_QUEUE_SIZE_SPI=4"], "extra_labels": ["Silicon_Labs", "EFM32"], "supported_toolchains": ["GCC_ARM", "ARM", "uARM", "IAR"], "device_has": ["ANALOGIN", "ANALOGOUT", "ERROR_PATTERN", "I2C", "I2CSLAVE", "I2C_ASYNCH", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "SPI_ASYNCH", "STDIO_MESSAGES"], @@ -1841,7 +1841,7 @@ "EFM32WG_STK3800": { "inherits": ["Target"], "core": "Cortex-M4F", - "macros": ["EFM32WG990F256"], + "macros": ["EFM32WG990F256", "TRANSACTION_QUEUE_SIZE_SPI=4"], "extra_labels": ["Silicon_Labs", "EFM32"], "supported_toolchains": ["GCC_ARM", "ARM", "uARM", "IAR"], "progen": {"target": "efm32wg-stk"}, @@ -1856,7 +1856,7 @@ "default_toolchain": "uARM", "supported_toolchains": ["GCC_ARM", "uARM", "IAR"], "extra_labels": ["Silicon_Labs", "EFM32"], - "macros": ["EFM32ZG222F32"], + "macros": ["EFM32ZG222F32", "TRANSACTION_QUEUE_SIZE_SPI=0"], "device_has": ["ANALOGIN", "ERROR_PATTERN", "I2C", "I2CSLAVE", "I2C_ASYNCH", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "SPI_ASYNCH", "STDIO_MESSAGES"], "default_lib": "small", "forced_reset_timeout": 2, @@ -1869,7 +1869,7 @@ "default_toolchain": "uARM", "supported_toolchains": ["GCC_ARM", "uARM", "IAR"], "extra_labels": ["Silicon_Labs", "EFM32"], - "macros": ["EFM32HG322F64"], + "macros": ["EFM32HG322F64", "TRANSACTION_QUEUE_SIZE_SPI=0"], "device_has": ["ANALOGIN", "ERROR_PATTERN", "I2C", "I2CSLAVE", "I2C_ASYNCH", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "SPI_ASYNCH", "STDIO_MESSAGES"], "default_lib": "small", "forced_reset_timeout": 2, @@ -1879,7 +1879,7 @@ "EFM32PG_STK3401": { "inherits": ["Target"], "core": "Cortex-M4F", - "macros": ["EFM32PG1B200F256GM48"], + "macros": ["EFM32PG1B200F256GM48", "TRANSACTION_QUEUE_SIZE_SPI=4"], "extra_labels": ["Silicon_Labs", "EFM32"], "supported_toolchains": ["GCC_ARM", "ARM", "uARM", "IAR"], "device_has": ["ANALOGIN", "ERROR_PATTERN", "I2C", "I2CSLAVE", "I2C_ASYNCH", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "SPI_ASYNCH", "STDIO_MESSAGES"],