

	#include "MEGA328_timer.txt"


	public void OS_run()
	{
		uint16 v;
		
		#asm "CLI"
		MACRO_GET_TIMER();
		#asm "SEI"
		
		type + 1;
		type % 3;
		if( type == 1 ) {
			S2.D0_OUT = 0;
			S3.D0_OUT = 1;
			Rvalue = (int)v;
		}
		else if( type == 2 ) {
			S2.D0_OUT = 1;
			S3.D0_OUT = 1;
			Bvalue = (int)v;
		}
		else {
			S2.D0_OUT = 0;
			S3.D0_OUT = 0;
			Gvalue = (int)v;
			
			cal_color();
		}
		MACRO_CLEAR_TIMER();
	}

