From f4e34a56c68ef873abd0ca2484335a31d0794f04 Mon Sep 17 00:00:00 2001 From: Erik Frojdh Date: Fri, 23 Oct 2026 14:06:46 +0200 Subject: [PATCH] uint32_t signature on usleep since the register read is 32bit... --- slsDetectorServers/slsDetectorServer/include/blackfin.h | 2 +- slsDetectorServers/slsDetectorServer/src/blackfin.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/slsDetectorServers/slsDetectorServer/include/blackfin.h b/slsDetectorServers/slsDetectorServer/include/blackfin.h index 16f1dbd7f..d6740a426 100644 --- a/slsDetectorServers/slsDetectorServer/include/blackfin.h +++ b/slsDetectorServers/slsDetectorServer/include/blackfin.h @@ -126,4 +126,4 @@ int mapCSP0(void); int initCycleCounter(void); /** busy-wait for usecs on the core cycle counter */ -void usleep_bf(uint64_t us); +void usleep_bf(uint32_t us); diff --git a/slsDetectorServers/slsDetectorServer/src/blackfin.c b/slsDetectorServers/slsDetectorServer/src/blackfin.c index b8cb9869b..3aa1b952c 100644 --- a/slsDetectorServers/slsDetectorServer/src/blackfin.c +++ b/slsDetectorServers/slsDetectorServer/src/blackfin.c @@ -180,12 +180,12 @@ int initCycleCounter(void) { } // usleep is not viable on blackfin (10 ms tick); spin on the core cycle counter -void usleep_bf(uint64_t us) { +void usleep_bf(uint32_t us) { #ifndef __bfin__ usleep(us); #else uint32_t start = get_cycles(); - uint32_t wait = (uint32_t)(us * bfinCyclesPerUs); // valid below ~8 s + uint32_t wait = us * bfinCyclesPerUs; // valid below ~8 s while ((uint32_t)(get_cycles() - start) < wait) ; #endif