void DWT_Delay(uint32_t hz){ int32_t tp = DWT_Get() + hz; while (DWT_Compare(tp)); }
void DWT_Delay(uint32_t us) // microseconds { int32_t tp = DWT_Get() + us * (SystemCoreClock1/1000000); while (DWT_Compare(tp)); }