source: anotherchoice/tags/jsp-1.4.4-full-UTF8/config/tlcs900-toshiba/zup_f16_ex/sys_config.c@ 363

Last change on this file since 363 was 363, checked in by ykominami, 5 years ago

add tags/jsp-1.4.4-full-UTF8

  • Property svn:executable set to *
File size: 7.6 KB
RevLine 
[363]1/*
2 * TOPPERS/JSP Kernel
3 * Toyohashi Open Platform for Embedded Real-Time Systems/
4 * Just Standard Profile Kernel
5 *
6 * Copyright (C) 2006-2010 by Witz Corporation, JAPAN
7 *
8 * The above copyright holders grant permission gratis to use,
9 * duplicate, modify, or redistribute (hereafter called use) this
10 * software (including the one made by modifying this software),
11 * provided that the following four conditions (1) through (4) are
12 * satisfied.
13 *
14 * (1) When this software is used in the form of source code, the above
15 * copyright notice, this use conditions, and the disclaimer shown
16 * below must be retained in the source code without modification.
17 *
18 * (2) When this software is redistributed in the forms usable for the
19 * development of other software, such as in library form, the above
20 * copyright notice, this use conditions, and the disclaimer shown
21 * below must be shown without modification in the document provided
22 * with the redistributed software, such as the user manual.
23 *
24 * (3) When this software is redistributed in the forms unusable for the
25 * development of other software, such as the case when the software
26 * is embedded in a piece of equipment, either of the following two
27 * conditions must be satisfied:
28 *
29 * (a) The above copyright notice, this use conditions, and the
30 * disclaimer shown below must be shown without modification in
31 * the document provided with the redistributed software, such as
32 * the user manual.
33 *
34 * (b) How the software is to be redistributed must be reported to the
35 * TOPPERS Project according to the procedure described
36 * separately.
37 *
38 * (4) The above copyright holders and the TOPPERS Project are exempt
39 * from responsibility for any type of damage directly or indirectly
40 * caused from the use of this software and are indemnified by any
41 * users or end users of this software from any and all causes of
42 * action whatsoever.
43 *
44 * THIS SOFTWARE IS PROVIDED "AS IS." THE ABOVE COPYRIGHT HOLDERS AND
45 * THE TOPPERS PROJECT DISCLAIM ANY EXPRESS OR IMPLIED WARRANTIES,
46 * INCLUDING, BUT NOT LIMITED TO, ITS APPLICABILITY TO A PARTICULAR
47 * PURPOSE. IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS AND THE
48 * TOPPERS PROJECT BE LIABLE FOR ANY TYPE OF DAMAGE DIRECTLY OR
49 * INDIRECTLY CAUSED FROM THE USE OF THIS SOFTWARE.
50 *
51 * 上記著作権者
52は,以下の (1)〜(4) の条件を満たす場合に限り,本ソフトウェ
53 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改変・
54 * 再é…
55å¸ƒï¼ˆä»¥ä¸‹ï¼Œåˆ©ç”¨ã¨å‘¼ã¶ï¼‰ã™ã‚‹ã“とを無償で許諾する.
56 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作権
57 * 表示,この利用条件および下記の無保証規定が,そのままの形でソース
58 * コード中に含まれていること.
59 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使用
60 * できる形で再é…
61å¸ƒã™ã‚‹å ´åˆã«ã¯ï¼Œå†é…
62å¸ƒã«ä¼´ã†ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆï¼ˆåˆ©ç”¨è€…
63マ
64 * ニュアルなど)に,上記の著作権表示,この利用条件および下記の無保
65 * 証規定を掲載すること.
66 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使用
67 * できない形で再é…
68å¸ƒã™ã‚‹å ´åˆã«ã¯ï¼Œæ¬¡ã®ã„ずれかの条件を満たすこと.
69 * (a) 再é…
70å¸ƒã«ä¼´ã†ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆï¼ˆåˆ©ç”¨è€…
71マニュアルなど)に,上記の著作
72 * 権表示,この利用条件および下記の無保証規定を掲載すること.
73 * (b) 再é…
74å¸ƒã®å½¢æ…
75‹ã‚’,別に定める方法によって,TOPPERSプロジェクトに報
76 * 告すること.
77 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損害
78 * からも,上記著作権者
79およびTOPPERSプロジェクトをå…
80è²¬ã™ã‚‹ã“と.また,
81 * 本ソフトウェアのユーザまたはエンドユーザからのいかなる理由に基づ
82 * く請求からも,上記著作権者
83およびTOPPERSプロジェクトをå…
84è²¬ã™ã‚‹ã“と.
85 *
86 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者
87およ
88 * びTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的に対す
89 * る適合性も含めて,いかなる保証も行わない.また,本ソフトウェアの利用
90 * により直接的または間接的に生じたいかなる損害に関しても,その責任を負
91 * わない.
92 *
93 * @(#) $Id: sys_config.c,v 1.1 2006/04/10 08:19:25 honda Exp $
94 */
95
96/*
97 * ターゲットシステム依存モジュール(Zup-F16拡張ボード用)
98 */
99
100
101#include "jsp_kernel.h"
102#include <sil.h>
103#include <tmp91cy22.h>
104#include "hw_serial.h"
105
106
107/* システムログ送信中フラグ */
108BOOL log_io_busy;
109
110/*
111 * ターゲットシステム依存 初期化ルーチン
112 */
113
114void
115sys_initialize()
116{
117 /*
118 * バナー表示用シリアルポートの初期化
119 *
120 * 送信バッファ空フラグが無く,ポーリングによる送信処理の実装
121が
122 * できないため,送信完了割込み要求フラグをポーリングし,初回送信
123 * 用にシステムログ送信中フラグを用いる.
124 */
125 /* システムログ送信中フラグ初期化 */
126 log_io_busy = FALSE;
127
128 /* シリアルI/Oドライバ初期化 */
129 /* 受信停止 */
130 sil_wrb_mem((VP)(TADR_SFR_SC1MOD0), 0x00 );
131 /* ポート設定(TXD1)として使用 */
132 sil_wrb_mem((VP)(TADR_SFR_P9FC), 0x08 );
133 sil_wrb_mem((VP)(TADR_SFR_P9CR), 0x08 );
134 /* 動作モード設定 */
135 sil_wrb_mem((VP)(TADR_SFR_SC1MOD0), (VB)(TBIT_SIOSMU8 | TBIT_SIOSCBRG) );
136 /* 8bitUARTモード,ボーレートジェネレータ使用 */
137 sil_reb_mem((VP)(TADR_SFR_SC1CR)); /* 読出しによりエラーフラグクリア */
138 sil_wrb_mem((VP)(TADR_SFR_SC1CR), 0x00 ); /* パリティ無し */
139 sil_wrb_mem((VP)(TADR_SFR_BR1CR), (VB)BRCR_19200);
140 /* φT2使用,19200bps,補正機能未使用 */
141 sil_wrb_mem((VP)(TADR_SFR_BR1ADD), BRADD_19200);
142 sil_wrb_mem((VP)(TADR_SFR_SC1MOD1), TBIT_SIOI2S);
143
144 /* シリアル割込み要求フラグクリア */
145 sil_wrb_mem((VP)(TADR_SFR_INTCLR), TBIT_TX1_CLR ); /* 送信要求クリア */
146
147 /* LED初期化 */
148 sil_wrb_mem((VP)(TADR_SFR_PA), 0xff );
149 sil_wrb_mem((VP)(TADR_SFR_PAFC), 0x00 );
150 sil_wrb_mem((VP)(TADR_SFR_PACR), 0xff );
151
152}
153
154/*
155 * ターゲットシステムの終了ルーチン
156 */
157
158void
159sys_exit(void)
160{
161 while(1);
162}
163
164/*
165 * システムログ用文字送信関数
166 *
167 * 本関数はCPUロック状æ…
168‹(割込み禁止)で実行すること
169 */
170void
171sys_putc(char c)
172{
173 /* 改行コードの場合å…
174ˆã«'\r'を送る */
175 if(c == '\n'){
176 if( log_io_busy == TRUE ){
177 /* 既に送信中の場合は割込み要求フラグをポーリング */
178 while( (sil_reb_mem((VP)(TADR_SFR_INTES1)) & TBIT_INTC_H) == 0 );
179 sil_wrb_mem((VP)TADR_SFR_INTCLR, (TBIT_TX1_CLR) ); /* 送信要求クリア */
180 sil_wrb_mem((VP)(TADR_SFR_SC1BUF), '\r');
181 }
182 else{
183 /* 送信状æ…
184‹ã«ã—て文字を送信 */
185 log_io_busy = TRUE;
186 sil_wrb_mem((VP)(TADR_SFR_SC1BUF), '\r');
187 }
188 }
189 if( log_io_busy == TRUE ){
190 /* 既に送信中の場合は割込み要求フラグをポーリング */
191 while( (sil_reb_mem((VP)(TADR_SFR_INTES1)) & TBIT_INTC_H) == 0 );
192 sil_wrb_mem((VP)TADR_SFR_INTCLR, (TBIT_TX1_CLR) ); /* 送信要求クリア */
193 sil_wrb_mem((VP)(TADR_SFR_SC1BUF), c);
194 }
195 else{
196 /* 送信状æ…
197‹ã«ã—て文字を送信 */
198 log_io_busy = TRUE;
199 sil_wrb_mem((VP)(TADR_SFR_SC1BUF), c);
200 }
201}
202
203
204
Note: See TracBrowser for help on using the repository browser.