uint32_t sectogo; int  mm,ss,hh;
*hh = (uint32_t) floor(len2 / (3600.F * 1000.F)); len2 -= (uint32_t) floor(*hh * 3600.F * 1000.F); *mm = (uint32_t) floor(len2 / (60.F * 1000.F)); len2 -= (uint32_t) floor(*mm * 60.F * 1000.F); *ss = (uint32_t) floor(len2 / (1000.F)); len2 -= (uint32_t) floor((*ss * 1000.F)); *ms = (uint32_t) floor(len2);
uint8_t ms2time(uint32_t ms, uint32_t *h,uint32_t *m, uint32_t *s){	uint32_t sectogo;   	int  mm,ss,hh;     				// d is in ms, divide by 1000 to get seconds	  			sectogo = (uint32_t) floor(ms / 1000.);				hh=sectogo/3600;				sectogo=sectogo-hh*3600;     				mm=sectogo/60;      				ss=sectogo%60;				*h=hh;				*m=mm;				*s=ss;	return 1;}