<commit_before>//=====================================================================//
/*!	@file
	@brief	UART の簡単なテスト
	@author	平松邦仁 (<EMAIL>)
*/
//=====================================================================//
#include <cstdint>
#include "G13/system.hpp"
#include "G13/port.hpp"
#include "common/uart_io.hpp"
#include "common/format.hpp"

namespace {
	void wait_()
	{
		asm("nop");
	}

	device::uart_io<device::SAU00, device::SAU01, 128, 128> uart_io_;
}

extern "C" {
	void sci_putch(char ch)
	{
		uart_io_.putch(ch);
	}

	void sci_puts(const char* str)
	{
		uart_io_.puts(str);
	}
};


int main(int argc, char* argv[])
{
	device::PM4.B3 = 0;  // output

	bool polling = true;
	uart_io_.start(115200, polling);

	uart_io_.puts("Start RL78/G13 uart test...\n");

	bool f = false;
///	uint32_t n = 0;
	while(1) {
		if(uart_io_.recv_length()) {
			auto ch = uart_io_.getch();
			uart_io_.putch(ch);

			device::P4.B3 = f;
			f = !f;
		}

///		utils::format("%d\n") % n;
///		++n;
	}
}<commit_msg>uart test, LED blinking, CR/LF<commit_after>//=====================================================================//
/*!	@file
	@brief	UART の簡単なテスト
	@author	平松邦仁 (<EMAIL>)
*/
//=====================================================================//
#include <cstdint>
#include "G13/system.hpp"
#include "G13/port.hpp"
#include "common/uart_io.hpp"
#include "common/format.hpp"

namespace {
	void wait_()
	{
		asm("nop");
	}

	device::uart_io<device::SAU00, device::SAU01, 128, 128> uart_io_;
}

extern "C" {
	void sci_putch(char ch)
	{
		uart_io_.putch(ch);
	}

	void sci_puts(const char* str)
	{
		uart_io_.puts(str);
	}
};


int main(int argc, char* argv[])
{
	device::PM4.B3 = 0;  // output

	bool polling = true;
	uart_io_.start(115200, polling);

	uart_io_.puts("Start RL78/G13 uart test...\n");

	bool f = false;
///	uint32_t n = 0;
	while(1) {
		for(uint32_t i = 0; i < 100000; ++i) {
			if(uart_io_.recv_length()) {
				auto ch = uart_io_.getch();
				if(ch == '\r') ch = '\n';
				uart_io_.putch(ch);
			}
		}
		device::P4.B3 = f;
		f = !f;
///		utils::format("%d\n") % n;
///		++n;
	}
}
{'fraction_non_alphanumeric': 0.31255946717411986, 'fraction_numerical': 0.0356803044719315, 'mean_word_length': 3.8013698630136985, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5786833', 'n_tokens_mistral': 997, 'n_tokens_neox': 864, 'n_words': 162}