<commit_before>#! /usr/bin/ruby
#
# Halt process when CTRL+C is pushed.

require 'serialport'
require '../lib/Lazurite'

@finish_flag=0
Signal.trap(:INT){
	@finish_flag=1
	$test.set_halt()
}

$test = Lazurite::Test.new

class Iotest

	def shutdown()
		result = $test.pwr(false)
	end

	def startup()
		$test.setTestBin(0)
		result = $test.pwr(true)
		if(result != "OK") then
			print(" Power on fail%d %d %d!!\n",result[0],result[1],result[2])
			return result
		else
			p result
		end
        return
	end

	def writeprog
        result = $test.boot_write("LAZURITE mini series","../bin/ML620Q504_000RA.bin")
        p result
        if(result != "OK") then
            printf(" Bootloader program Fail %d %d %d!!\n",result[0],result[1],result[2])
            return result
        end
        
        sleep(0.1)
        
        result = $test.prog_write("LAZURITE mini series","../bin/test.bin")
        if(result != "OK") then
            printf(" Program write Fail %d %d %d!!\n",result[0],result[1],result[2])
            return result
        else
            p result
        end
        return
	end


	def alltest
		result = $test.iotest()
		if(result != "OK") then
			printf(" IO Test Fail %d pin error!!\n",result[2])<commit_msg>update iotest<commit_after>#! /usr/bin/ruby
#
# Halt process when CTRL+C is pushed.

require 'serialport'
require '../lib/Lazurite'

@finish_flag=0
Signal.trap(:INT){
	@finish_flag=1
	$test.set_halt()
}

$test = Lazurite::Test.new

class Iotest

	def shutdown()
		result = $test.pwr(false)
	end

	def startup()
		$test.setTestBin(0)
		result = $test.pwr(true)
		if(result != "OK") then
			print(" Power on fail%d %d %d!!\n",result[0],result[1],result[2])
			return result
		else
			p result
		end
        return
	end

	def writeprog
        result = $test.boot_write("LAZURITE mini series","../bin/ML620Q504_000RA.bin")
        p result
        if(result != "OK") then
            printf(" Bootloader program Fail %d %d %d!!\n",result[0],result[1],result[2])
            return result
        end
        
        sleep(0.5)
        
        result = $test.prog_write("LAZURITE mini series","../bin/test.bin")
        if(result != "OK") then
            printf(" Program write Fail %d %d %d!!\n",result[0],result[1],result[2])
            return result
        else
            p result
        end
        return
	end


	def alltest
		result = $test.iotest()
		if(result != "OK") then
			printf(" IO Test Fail %d pin error!!\n",result[2])
{'fraction_non_alphanumeric': 0.1509281678773204, 'fraction_numerical': 0.01937046004842615, 'mean_word_length': 2.4240331491712706, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4846961', 'n_tokens_mistral': 940, 'n_tokens_neox': 883, 'n_words': 210}