review corrections

pull/7745/head
Jarno Lamsa 2018-08-20 10:38:44 +03:00 committed by Olli-Pekka Puolitaival
parent ccf4416c70
commit c38769b499
8 changed files with 101 additions and 14 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015-2016 ARM Limited. All rights reserved. * Copyright (c) 2018 ARM Limited. All rights reserved.
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* Licensed under the Apache License, Version 2.0 (the License); you may * Licensed under the Apache License, Version 2.0 (the License); you may
* not use this file except in compliance with the License. * not use this file except in compliance with the License.
@ -28,6 +28,8 @@
#define mbed_console_concat(x) mbed_console_concat_(x) #define mbed_console_concat(x) mbed_console_concat_(x)
#define CONSOLE_FLOWCONTROL mbed_console_concat(MBED_CONF_TARGET_CONSOLE_UART_FLOW_CONTROL) #define CONSOLE_FLOWCONTROL mbed_console_concat(MBED_CONF_TARGET_CONSOLE_UART_FLOW_CONTROL)
#define SERIAL_CONSOLE_BAUD_RATE 115200
void cmd_ready_cb(int retcode) void cmd_ready_cb(int retcode)
{ {
cmd_next(retcode); cmd_next(retcode);
@ -49,7 +51,7 @@ int main()
} }
FileHandle* mbed::mbed_override_console(int) { FileHandle* mbed::mbed_override_console(int) {
static UARTSerial console(STDIO_UART_TX, STDIO_UART_RX, 115200); static UARTSerial console(STDIO_UART_TX, STDIO_UART_RX, SERIAL_CONSOLE_BAUD_RATE);
#if CONSOLE_FLOWCONTROL == CONSOLE_FLOWCONTROL_RTS #if CONSOLE_FLOWCONTROL == CONSOLE_FLOWCONTROL_RTS
console.set_flow_control(SerialBase::RTS, STDIO_UART_RTS, NC); console.set_flow_control(SerialBase::RTS, STDIO_UART_RTS, NC);
#elif CONSOLE_FLOWCONTROL == CONSOLE_FLOWCONTROL_CTS #elif CONSOLE_FLOWCONTROL == CONSOLE_FLOWCONTROL_CTS

View File

@ -1,3 +1,18 @@
/*
* Copyright (c) 2018 ARM Limited. All rights reserved.
* 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.
*/
#include "NetworkStack.h" #include "NetworkStack.h"
#include "NetworkInterface.h" #include "NetworkInterface.h"
@ -41,6 +56,7 @@ static bool is_ipv4(const char *str)
static void ifconfig_print() static void ifconfig_print()
{ {
if(!net) if(!net)
cmd_printf("No interface configured\r\n");
return; return;
const char *str = net->get_ip_address(); const char *str = net->get_ip_address();

View File

@ -1,3 +1,18 @@
/*
* Copyright (c) 2018 ARM Limited. All rights reserved.
* 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 CMD_IFCONFIG_H #ifndef CMD_IFCONFIG_H
#define CMD_IFCONFIG_H #define CMD_IFCONFIG_H

View File

@ -1,3 +1,18 @@
/*
* Copyright (c) 2018 ARM Limited. All rights reserved.
* 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.
*/
#include "mbed.h" #include "mbed.h"
#include "NetworkStack.h" #include "NetworkStack.h"
#include "UDPSocket.h" #include "UDPSocket.h"

View File

@ -1,3 +1,18 @@
/*
* Copyright (c) 2018 ARM Limited. All rights reserved.
* 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 CMD_SOCKET_H_ #ifndef CMD_SOCKET_H_
#define CMD_SOCKET_H_ #define CMD_SOCKET_H_

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015-2016 ARM Limited. All rights reserved. * Copyright (c) 2018 ARM Limited. All rights reserved.
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
* Licensed under the Apache License, Version 2.0 (the License); you may * Licensed under the Apache License, Version 2.0 (the License); you may
* not use this file except in compliance with the License. * not use this file except in compliance with the License.
@ -30,6 +30,8 @@
#define mbed_console_concat(x) mbed_console_concat_(x) #define mbed_console_concat(x) mbed_console_concat_(x)
#define CONSOLE_FLOWCONTROL mbed_console_concat(MBED_CONF_TARGET_CONSOLE_UART_FLOW_CONTROL) #define CONSOLE_FLOWCONTROL mbed_console_concat(MBED_CONF_TARGET_CONSOLE_UART_FLOW_CONTROL)
#define SERIAL_CONSOLE_BAUD_RATE 115200
void cmd_ready_cb(int retcode) void cmd_ready_cb(int retcode)
{ {
cmd_next(retcode); cmd_next(retcode);
@ -53,7 +55,7 @@ int main()
} }
FileHandle* mbed::mbed_override_console(int) { FileHandle* mbed::mbed_override_console(int) {
static UARTSerial console(STDIO_UART_TX, STDIO_UART_RX, 115200); static UARTSerial console(STDIO_UART_TX, STDIO_UART_RX, SERIAL_CONSOLE_BAUD_RATE);
#if CONSOLE_FLOWCONTROL == CONSOLE_FLOWCONTROL_RTS #if CONSOLE_FLOWCONTROL == CONSOLE_FLOWCONTROL_RTS
console.set_flow_control(SerialBase::RTS, STDIO_UART_RTS, NC); console.set_flow_control(SerialBase::RTS, STDIO_UART_RTS, NC);
#elif CONSOLE_FLOWCONTROL == CONSOLE_FLOWCONTROL_CTS #elif CONSOLE_FLOWCONTROL == CONSOLE_FLOWCONTROL_CTS

View File

@ -1,7 +1,18 @@
/* /*
* Copyright (c) 2016 ARM Limited. All rights reserved. * Copyright (c) 2018 ARM Limited. All rights reserved.
* 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.
*/ */
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>

View File

@ -1,7 +1,18 @@
/* /*
* Copyright (c) 2016 ARM Limited. All rights reserved. * Copyright (c) 2018 ARM Limited. All rights reserved.
* 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 STRCONVERSION_H #ifndef STRCONVERSION_H
#define STRCONVERSION_H #define STRCONVERSION_H