Commit 8e7b7ac9 authored by Marko Kiiskila's avatar Marko Kiiskila Committed by Fabio Utzig
Browse files

boot_uart: mynewt; option for faster speed with serial.

Make RX buffer size configurable for UART. Allow incoming
interrupts while copying data out of that buffer.

Signed-off-by: default avatarMarko Kiiskila <marko@apache.org>
parent e280e116
Loading
Loading
Loading
Loading
+8 −3
Changes for boot/mynewt/boot_uart/src/boot_uart.c: 8 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -30,9 +30,9 @@
#define CONSOLE_TAIL_INC(cr) (((cr)->tail + 1) & (sizeof((cr)->buf) - 1))

struct {
    uint8_t head;
    uint8_t tail;
    uint8_t buf[16];
    uint16_t head;
    uint16_t tail;
    uint8_t buf[MYNEWT_VAL(CONSOLE_UART_RX_BUF_SIZE)];
} bs_uart_rx;

struct {
@@ -119,6 +119,11 @@ boot_uart_read(char *str, int cnt, int *newline)
            *newline = 1;
            break;
        }
        /*
         * Unblock interrupts allowing more incoming data.
         */
        OS_EXIT_CRITICAL(sr);
        OS_ENTER_CRITICAL(sr);
        *str++ = ch;
    }
    OS_EXIT_CRITICAL(sr);
+24
Changes for boot/mynewt/boot_uart/syscfg.yml: 24 added lines, 0 removed lines.
Original line number Diff line number Diff line
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you 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.
#

syscfg.defs:
    CONSOLE_UART_RX_BUF_SIZE:
        description: >
            UART console receive buffer size; must be power of 2.
        value: 32