Ignore:
Timestamp:
Apr 5, 2019, 9:26:53 PM (5 years ago)
Author:
coas-nagasima
Message:

mbed関連を更新
シリアルドライバをmbedのHALを使うよう変更
ファイルディスクリプタの処理を更新

File:
1 edited

Legend:

Unmodified
Added
Removed
  • asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_citrus_gcc/target_kernel_impl.c

    r364 r374  
    5353#include "syssvc/serial.h"
    5454#ifdef TOPPERS_OMIT_TECS
    55 #include "rx630_uart.h"
     55#include "serial_api.h"
     56#endif
     57
     58#ifdef TOPPERS_OMIT_TECS
     59serial_t log_serial;
    5660#endif
    5761
     
    7579                sil_reb_mem(PORTA_PDR_ADDR) & ~PORT_PDR_B7_BIT);
    7680
     81#ifdef TOPPERS_OMIT_TECS
    7782        /*
    7883         *  シリアルポートの設定
    7984         */
    80 
    81         /* ポートP20をTxD0, ポートP21をRxD0に */
    82         sil_wrb_mem(PORT2_PMR_ADDR, 0x03);
    83 
    84         /* データディレクションレジスタ(PDR)の設定 P21(RxD0)を入力ポートにする */
    85         sil_wrb_mem(PORT2_PDR_ADDR,
    86                 sil_reb_mem(PORT2_PDR_ADDR) & ~PORT_PDR_B1_BIT);
    87 
    88         /* データディレクションレジスタ(PDR)の設定 P20(TxD0)を出力ポートにする */
    89         sil_wrb_mem(PORT2_PDR_ADDR,
    90                 sil_reb_mem(PORT2_PDR_ADDR) | PORT_PDR_B0_BIT);
     85        serial_init(&log_serial, P20, P21);
     86        serial_baud(&log_serial, UART_BAUDRATE);
     87        serial_format(&log_serial, 8, ParityNone, 1);
     88#endif
    9189
    9290        /* ポートP40~P47を周辺機器に */
     
    149147{
    150148        if (c == '\n') {
    151                 rx630_uart_pol_putc('\r', TARGET_PUTC_PORTID);
     149                serial_putc(&log_serial, '\r');
    152150        }
    153151
    154         rx630_uart_pol_putc(c, TARGET_PUTC_PORTID);
     152        serial_putc(&log_serial, c);
    155153}
    156154#endif
Note: See TracChangeset for help on using the changeset viewer.