<commit_before><html>
<head>
	<link rel="stylesheet" type="text/css" href="style.css">
	<title>Scan I2C</title>
	<script src="libs.js"></script>
	<script>
		var addr_enumerator = -4;
		var last_checked = '0x00';
		function send() {
			if(addr_enumerator < 0) {
				byId('status').innerHTML = 'Done, checked 0x00 - ' + last_checked;
				if(byId('output').innerHTML.length == 0)
					byId('output').innerHTML = 'Nothing was found'
				return;
			}
			current_addr = '0x' + addr_enumerator.toString(16).toUpperCase();
			last_checked = current_addr;
			byId('status').innerHTML = 'Checking ' + current_addr + '...';
			localStorage['accesskey'] = byId('accesskey').value;
			parameters = {
				"SDA": byId('sda').value,
				"SCL": byId('scl').value,
				"address": current_addr,
				"count": 1
			};

			send_command('i2c/master/read', parameters, getKey(), function (err, res) {
				if(!err) {
					byId('output').innerHTML += 'Found ' + current_addr + '<br>';
				}
				addr_enumerator += 2;
				if(addr_enumerator > 255)
					addr_enumerator = -4;
				send();
			});
		}

		function init() {
			byId('accesskey').value = localStorage['accesskey'];
		}

		function run() {
			if(addr_enumerator < 0) {
				byId('output').innerHTML = "";
				byId('status').innerHTML = "";
				addr_enumerator = 0;
				send();
			}
		}

		function stop() {
			addr_enumerator = -4;
		}
	</script>
</head>
<body onload="init()">
<div class="header">
	<a href="./help.html"><div class="devecihive-logo-text"></div></a>
	<div class="key-box">
		<label for="accesskey">AccesKey: </label>
		<input class="input-accesskey input-data" type="password" id="accesskey">
	</div>
</div>
<div class="content">
	<ul class="description description_list">
		This sample scans I2C bus via enumrating addresses to detect devices on it.
	</ul>
	<div class="form-block">
		<label class="pin-label" for="sda">SDA Pin:
			<input class="input-data" type='text' id='sda' value='0'>
		</label>
		<label class="pin-label" for="scl">SCL Pin:
			<input class="input-data" type='text' id='scl' value='2'>
		</label>
		<button class="btn_event" type="button" value="Run" onclick="run();">Run</button>
		<button class="btn_event" type="button" value="Stop" onclick="stop();">Stop</button>
	</div>
	<div id="status"></div>
	<div id="output"></div>
</div>
</body>
</html><commit_msg>buttons colors<commit_after><html>
<head>
	<link rel="stylesheet" type="text/css" href="style.css">
	<title>Scan I2C</title>
	<script src="libs.js"></script>
	<script>
		var addr_enumerator = -4;
		var last_checked = '0x00';
		function send() {
			if(addr_enumerator < 0) {
				byId('status').innerHTML = 'Done, checked 0x00 - ' + last_checked;
				if(byId('output').innerHTML.length == 0)
					byId('output').innerHTML = 'Nothing was found'
				return;
			}
			current_addr = '0x' + addr_enumerator.toString(16).toUpperCase();
			last_checked = current_addr;
			byId('status').innerHTML = 'Checking ' + current_addr + '...';
			localStorage['accesskey'] = byId('accesskey').value;
			parameters = {
				"SDA": byId('sda').value,
				"SCL": byId('scl').value,
				"address": current_addr,
				"count": 1
			};

			send_command('i2c/master/read', parameters, getKey(), function (err, res) {
				if(!err) {
					byId('output').innerHTML += 'Found ' + current_addr + '<br>';
				}
				addr_enumerator += 2;
				if(addr_enumerator > 255)
					addr_enumerator = -4;
				send();
			});
		}

		function init() {
			byId('accesskey').value = localStorage['accesskey'];
		}

		function run() {
			if(addr_enumerator < 0) {
				byId('output').innerHTML = "";
				byId('status').innerHTML = "";
				addr_enumerator = 0;
				send();
			}
		}

		function stop() {
			addr_enumerator = -4;
		}
	</script>
</head>
<body onload="init()">
<div class="header">
	<a href="./help.html"><div class="devecihive-logo-text"></div></a>
	<div class="key-box">
		<label for="accesskey">AccesKey: </label>
		<input class="input-accesskey input-data" type="password" id="accesskey">
	</div>
</div>
<div class="content">
	<ul class="description description_list">
		This sample scans I2C bus via enumrating addresses to detect devices on it.
	</ul>
	<div class="form-block">
		<label class="pin-label" for="sda">SDA Pin:
			<input class="input-data" type='text' id='sda' value='0'>
		</label>
		<label class="pin-label" for="scl">SCL Pin:
			<input class="input-data" type='text' id='scl' value='2'>
		</label>
		<button class="btn_event btn_event_green" type="button" value="Run" onclick="run();">Run</button>
		<button class="btn_event btn_event_red" type="button" value="Stop" onclick="stop();">Stop</button>
	</div>
	<div id="status"></div>
	<div id="output"></div>
</div>
</body>
</html>
{'fraction_non_alphanumeric': 0.2015768165352653, 'fraction_numerical': 0.0110803324099723, 'mean_word_length': 4.069114470842333, 'pattern_counts': {'":': 8, '<': 97, '<?xml version=': 0, '>': 95, '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': '3806706', 'n_tokens_mistral': 1951, 'n_tokens_neox': 1686, 'n_words': 336}