NRF52 : Fix UART RTS initialization

The preprocessor based macro check #if evaluates all
enums as 0 and hence the code does not get compiled.
Since move this to a runtime check where the pin variable
can be correctly evaluated.

Delete mbed_overrides.c as it has a target specific mbed_sdk_init() to
resolve linking problem.

This is a follow on patch to:
https://github.com/ARMmbed/mbed-os/pull/8046
pull/8474/head
Naveen Kaje 2018-10-18 15:58:05 -05:00
parent c40d86038c
commit 7beb8d3f4b
6 changed files with 15 additions and 28 deletions

View File

@ -141,6 +141,8 @@ typedef enum {
USBRX = RX_PIN_NUMBER,
STDIO_UART_TX = TX_PIN_NUMBER,
STDIO_UART_RX = RX_PIN_NUMBER,
STDIO_UART_CTS = CTS_PIN_NUMBER,
STDIO_UART_RTS = RTS_PIN_NUMBER,
SPI_PSELMOSI0 = p23,
SPI_PSELMISO0 = p24,

View File

@ -1,22 +0,0 @@
/* mbed Microcontroller Library
* Copyright (c) 2006-2016 ARM Limited
*
* 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.
*/
void mbed_sdk_init()
{
char* debug_date = __DATE__;
char* debug_time = __TIME__;
}

View File

@ -121,6 +121,8 @@ typedef enum {
RTS_PIN_NUMBER = p31,
STDIO_UART_TX = TX_PIN_NUMBER,
STDIO_UART_RX = RX_PIN_NUMBER,
STDIO_UART_CTS = CTS_PIN_NUMBER,
STDIO_UART_RTS = RTS_PIN_NUMBER,
I2C_SDA = p2,
I2C_SCL = p3,

View File

@ -132,6 +132,8 @@ typedef enum {
RTS_PIN_NUMBER = p2,
STDIO_UART_TX = TX_PIN_NUMBER,
STDIO_UART_RX = RX_PIN_NUMBER,
STDIO_UART_CTS = CTS_PIN_NUMBER,
STDIO_UART_RTS = RTS_PIN_NUMBER,
// mBed interface Pins
USBTX = TX_PIN_NUMBER,

View File

@ -86,6 +86,8 @@ typedef enum {
RTS_PIN_NUMBER = p31,
STDIO_UART_TX = TX_PIN_NUMBER,
STDIO_UART_RX = RX_PIN_NUMBER,
STDIO_UART_CTS = CTS_PIN_NUMBER,
STDIO_UART_RTS = RTS_PIN_NUMBER,
I2C_SDA0 = p2,
I2C_SCL0 = p3,

View File

@ -113,12 +113,13 @@ void nrf_reloc_vector_table(void)
#endif
}
#if (STDIO_UART_RTS != NC)
void mbed_sdk_init(void)
{
gpio_t rts;
gpio_init_out(&rts, STDIO_UART_RTS);
/* Set STDIO_UART_RTS as gpio driven low */
gpio_write(&rts, 0);
if (STDIO_UART_RTS != NC) {
gpio_t rts;
gpio_init_out(&rts, STDIO_UART_RTS);
/* Set STDIO_UART_RTS as gpio driven low */
gpio_write(&rts, 0);
}
}
#endif