//#include "main.h"
#include <string.h>
#include "ad0x0_perf.h"

ad0x0_perf_s perfs;

void	ad0x0_perf_init(void){
	__disable_irq();
	memset(&perfs,0,sizeof(ad0x0_perf_s));
	perfs.idle=1;
	__enable_irq();
}
void	ad0x0_perf_tick_task(void){
	perfs.t1++;
}
void	ad0x0_perf_tick_idle(void){
	perfs.idle++;
	if(perfs.idle>1000)ad0x0_perf_init();
}
uint8_t	ad0x0_get_perf(void){
	uint8_t res=perfs.t1 / (perfs.idle + perfs.t1);
	return res;
}

