> For the complete documentation index, see [llms.txt](https://sdk.twelite.info/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sdk.twelite.info/hw-api-ref/perifuraru/uart/serial-raiburari/serial_vflush.md).

# SERIAL\_vFlush()

## 解説

SERIAL ライブラリによる出力要求が終了するまで待つ。

{% hint style="info" %}
スリープ前に全てのメッセージを出力するような場合に利用します。通常は十分な出力用のFIFOバッファーを確保し、極力呼び出しさないようにする処理を推奨します。
{% endhint %}

{% hint style="warning" %}
出力完了待ちの処理で動作が不安定になる場合があります。この場合は、この待ち処理を削除して動作確認します。

待ち処理を省略し出力が途切れる場合は、出力用のFIFOメモリを余分に確保します。
{% endhint %}

## 引数 <a href="#yin-shu" id="yin-shu"></a>

| 型     | 名前           | 詳細                                                  |
| ----- | ------------ | --------------------------------------------------- |
| uint8 | u8SerialPort | シリアルポート (E\_AHI\_UART\_0 または E\_AHI\_UART\_1 を指定する） |

## 戻り値

なし。

## サンプル

```c
void cbToCoNet_vMain(void) {
	while (!SERIAL_bRxQueueEmpty(sSerPort.u8SerialPort)) {
		int16 i16Char;
​		i16Char = SERIAL_i16RxChar(sSerPort.u8SerialPort);
​		vfPrintf(&sSerStream, "\n\r# [%c] --> ", i16Char);
	    SERIAL_vFlush(sSerStream.u8Device);
		...
	}
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sdk.twelite.info/hw-api-ref/perifuraru/uart/serial-raiburari/serial_vflush.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
