Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/arm32/src/putchar.c

    rf1fc83a r4872160  
    22 * Copyright (c) 2007 Michal Kebrt
    33 * Copyright (c) 2009 Vineeth Pillai
    4  * Copyright (c) 2010 Jiri Svoboda
    54 * All rights reserved.
    65 *
     
    4140#include <str.h>
    4241
    43 #ifdef MACHINE_gta02
    44 
    45 /** Send a byte to the gta02 serial console.
    46  *
    47  * @param byte          Byte to send.
    48  */
    49 static void scons_sendb_gta02(uint8_t byte)
    50 {
    51         volatile uint32_t *utrstat;
    52         volatile uint32_t *utxh;
    53 
    54         utrstat = (volatile uint32_t *) GTA02_SCONS_UTRSTAT;
    55         utxh    = (volatile uint32_t *) GTA02_SCONS_UTXH;
    56 
    57         /* Wait until transmitter is empty. */
    58         while ((*utrstat & S3C24XX_UTXH_TX_EMPTY) == 0)
    59                 ;
    60 
    61         /* Transmit byte. */
    62         *utxh = (uint32_t) byte;
    63 }
    64 
    65 #endif
    66 
    67 #ifdef MACHINE_testarm
    68 
    69 /** Send a byte to the GXemul testarm serial console.
    70  *
    71  * @param byte          Byte to send.
    72  */
    73 static void scons_sendb_testarm(uint8_t byte)
    74 {
    75         *((volatile uint8_t *) TESTARM_SCONS_ADDR) = byte;
    76 }
    77 
    78 #endif
    79 
    80 #ifdef MACHINE_integratorcp
    81 
    82 /** Send a byte to the IntegratorCP serial console.
    83  *
    84  * @param byte          Byte to send.
    85  */
    86 static void scons_sendb_icp(uint8_t byte)
    87 {
    88         *((volatile uint8_t *) ICP_SCONS_ADDR) = byte;
    89 }
    90 
    91 #endif
    92 
    93 /** Send a byte to the serial console.
    94  *
    95  * @param byte          Byte to send.
    96  */
    97 static void scons_sendb(uint8_t byte)
    98 {
    99 #ifdef MACHINE_gta02
    100         scons_sendb_gta02(byte);
    101 #endif
    102 #ifdef MACHINE_testarm
    103         scons_sendb_testarm(byte);
    104 #endif
    105 #ifdef MACHINE_integratorcp
    106         scons_sendb_icp(byte);
    107 #endif
    108 }
    109 
    110 /** Display a character
    111  *
    112  * @param ch    Character to display
    113  */
    11442void putchar(const wchar_t ch)
    11543{
    11644        if (ch == '\n')
    117                 scons_sendb('\r');
    118 
     45                *((volatile char *) VIDEORAM_ADDRESS) = '\r';
     46       
    11947        if (ascii_check(ch))
    120                 scons_sendb((uint8_t) ch);
     48                *((volatile char *) VIDEORAM_ADDRESS) = ch;
    12149        else
    122                 scons_sendb(U_SPECIAL);
     50                *((volatile char *) VIDEORAM_ADDRESS) = U_SPECIAL;
    12351}
    12452
Note: See TracChangeset for help on using the changeset viewer.