min max detection/ higher clokrate
This commit is contained in:
		
							
								
								
									
										23
									
								
								clkgen.c
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								clkgen.c
									
									
									
									
									
								
							@ -156,8 +156,8 @@ static void handle_switches()
 | 
				
			|||||||
				single_step=0;
 | 
									single_step=0;
 | 
				
			||||||
				return;
 | 
									return;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		
 | 
								if (disp_nr>0)		
 | 
				
			||||||
			disp_nr--;
 | 
									disp_nr--;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -168,7 +168,9 @@ static void handle_switches()
 | 
				
			|||||||
				single_step=0;
 | 
									single_step=0;
 | 
				
			||||||
				return;
 | 
									return;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			disp_nr++;
 | 
								if (disp_nr<99)
 | 
				
			||||||
 | 
									disp_nr++;
 | 
				
			||||||
 | 
								
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -205,7 +207,7 @@ static void update_display()
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define COU0 11
 | 
					#define COU0 11
 | 
				
			||||||
#define COU1 1000
 | 
					#define COU1 10
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void cou0()
 | 
					static void cou0()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@ -224,19 +226,22 @@ static void pulser()
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
	if(pulse>0){
 | 
						if(pulse>0){
 | 
				
			||||||
		P2_6 = 1;
 | 
							P2_6 = 1;
 | 
				
			||||||
 | 
							P1_2 = 1;
 | 
				
			||||||
 | 
							P1_3 = 0;
 | 
				
			||||||
		pulse--;
 | 
							pulse--;
 | 
				
			||||||
		return;	
 | 
							return;	
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	P2_6=0;
 | 
						P2_6=0;
 | 
				
			||||||
 | 
						P1_2=0;
 | 
				
			||||||
 | 
						P1_3=1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void cou1()
 | 
					static void cou1()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	static int ctr = 99;
 | 
						static int ctr = 9900;
 | 
				
			||||||
 | 
					 | 
				
			||||||
	static int count=COU1;
 | 
						static int count=COU1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
@ -252,13 +257,9 @@ static void cou1()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	ctr-=disp_nr;
 | 
						ctr-=disp_nr;
 | 
				
			||||||
	if (ctr <=0){
 | 
						if (ctr <=0){
 | 
				
			||||||
		ctr+=99;
 | 
							ctr+=9900;
 | 
				
			||||||
		pulse=PULSE_LEN;
 | 
							pulse=PULSE_LEN;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
//	if (disp_nr>99)
 | 
					 | 
				
			||||||
//		disp_nr=0;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user