X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=lib%2Fccdbg-io.c;h=e5e85e4390ff1220c3eebf12f30fe42a820b2d9e;hp=53ea758342c6f22f055c42549bc2fc3c403c8336;hb=60940b4be23962db79b8e914ec943d0636dd68ad;hpb=eb09e61b0682eb2aeac8e1a34d58b897ba6db8e7 diff --git a/lib/ccdbg-io.c b/lib/ccdbg-io.c index 53ea7583..e5e85e43 100644 --- a/lib/ccdbg-io.c +++ b/lib/ccdbg-io.c @@ -24,12 +24,20 @@ #include "cp-usb.h" #endif +static uint32_t cc_clock_us = CC_CLOCK_US; + +void +ccdbg_set_clock(uint32_t us) +{ + cc_clock_us = us; +} + void ccdbg_half_clock(struct ccdbg *dbg) { struct timespec req, rem; - req.tv_sec = (CC_CLOCK_US / 2) / 1000000; - req.tv_nsec = ((CC_CLOCK_US / 2) % 1000000) * 1000; + req.tv_sec = (cc_clock_us / 2) / 1000000; + req.tv_nsec = ((cc_clock_us / 2) % 1000000) * 1000; nanosleep(&req, &rem); }