Changeset 6e82e9e8 in rtems


Ignore:
Timestamp:
Jul 28, 2021, 5:02:54 PM (7 weeks ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
4adaed73
Parents:
79b94a2d
git-author:
Sebastian Huber <sebastian.huber@…> (07/28/21 17:02:54)
git-committer:
Sebastian Huber <sebastian.huber@…> (07/28/21 17:05:42)
Message:

libcsupport: Consistent rtems_putc() output

Use the same function to output the '\r\n' combination produced by
rtems_putc(). Fix the format.

Change licence according to file history.

Update #3053.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libcsupport/src/rtems_putc.c

    r79b94a2d r6e82e9e8  
     1/* SPDX-License-Identifier: BSD-2-Clause */
     2
    13/**
    2  *  @file
     4 * @file
    35 *
    4  *  @brief RTEMS Output a Character
    5  *  @ingroup libcsupport
     6 * @ingroup BSPIO
     7 *
     8 * @brief This source file contains the implementation of rtems_putc().
    69 */
    710
    811/*
    9  * Copyright (c) 2012, 2017 embedded brains GmbH.  All rights reserved.
     12 * Copyright (C) 2012, 2021 embedded brains GmbH (http://www.embedded-brains.de)
    1013 *
    11  *  embedded brains GmbH
    12  *  Obere Lagerstr. 30
    13  *  82178 Puchheim
    14  *  Germany
    15  *  <rtems@embedded-brains.de>
     14 * Redistribution and use in source and binary forms, with or without
     15 * modification, are permitted provided that the following conditions
     16 * are met:
     17 * 1. Redistributions of source code must retain the above copyright
     18 *    notice, this list of conditions and the following disclaimer.
     19 * 2. Redistributions in binary form must reproduce the above copyright
     20 *    notice, this list of conditions and the following disclaimer in the
     21 *    documentation and/or other materials provided with the distribution.
    1622 *
    17  * The license and distribution terms for this file may be
    18  * found in the file LICENSE in this distribution or at
    19  * http://www.rtems.org/license/LICENSE.
     23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
     27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     33 * POSSIBILITY OF SUCH DAMAGE.
    2034 */
    2135
     
    2640#include <rtems/bspIo.h>
    2741
    28 void rtems_putc(char c)
     42void rtems_putc( char c )
    2943{
    30   if (c == '\n') {
    31     (*BSP_output_char)('\r');
     44  BSP_output_char_function_type output_char;
     45
     46  output_char = BSP_output_char;
     47
     48  if ( c == '\n' ) {
     49    ( *output_char )( '\r' );
    3250  }
    3351
    34   (*BSP_output_char)(c);
     52  ( *output_char )( c );
    3553}
Note: See TracChangeset for help on using the changeset viewer.