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_sakura_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
     
    7882                sil_reb_mem(PORTA_PDR_ADDR) & ~PORT_PDR_B7_BIT);
    7983
     84#ifdef TOPPERS_OMIT_TECS
    8085        /*
    8186         *  シリアルポートの設定
    8287         */
    83 
    84         /* ポートP20をTxD0, ポートP21をRxD0に */
    85         sil_wrb_mem(PORT2_PMR_ADDR, 0x03);
    86 
    87         /* データディレクションレジスタ(PDR)の設定 P21(RxD0)を入力ポートにする */
    88         sil_wrb_mem(PORT2_PDR_ADDR,
    89                 sil_reb_mem(PORT2_PDR_ADDR) & ~PORT_PDR_B1_BIT);
    90 
    91         /* データディレクションレジスタ(PDR)の設定 P20(TxD0)を出力ポートにする */
    92         sil_wrb_mem(PORT2_PDR_ADDR,
    93                 sil_reb_mem(PORT2_PDR_ADDR) | PORT_PDR_B0_BIT);
     88        serial_init(&log_serial, P20, P21);
     89        serial_baud(&log_serial, UART_BAUDRATE);
     90        serial_format(&log_serial, 8, ParityNone, 1);
     91#endif
    9492
    9593        /* ポートP40~P47を周辺機器に */
     
    152150{
    153151        if (c == '\n') {
    154                 rx630_uart_pol_putc('\r', TARGET_PUTC_PORTID);
     152                serial_putc(&log_serial, '\r');
    155153        }
    156154
    157         rx630_uart_pol_putc(c, TARGET_PUTC_PORTID);
     155        serial_putc(&log_serial, c);
    158156}
    159157#endif
Note: See TracChangeset for help on using the changeset viewer.