@@ -54,10 +54,10 @@ HardwarePWM* HwPWMx[] =
5454};
5555
5656#if CFG_DEBUG
57- bool can_stringify_token (uintptr_t token)
57+ bool can_stringify_token (uint32_t token)
5858{
5959 uint8_t * t = (uint8_t *)&token;
60- for (size_t i = 0 ; i < sizeof (uintptr_t ); ++i, ++t)
60+ for (size_t i = 0 ; i < sizeof (uint32_t ); ++i, ++t)
6161 {
6262 uint8_t x = *t;
6363 if ((x < 0x20 ) || (x > 0x7E )) return false ;
@@ -71,7 +71,7 @@ void HardwarePWM::DebugOutput(Stream& logger)
7171 logger.printf (" HwPWM Debug:" );
7272 for (size_t i = 0 ; i < count; i++) {
7373 HardwarePWM const * pwm = HwPWMx[i];
74- uintptr_t token = pwm->_owner_token ;
74+ uint32_t token = pwm->_owner_token ;
7575 logger.printf (" || %d:" , i);
7676 if (can_stringify_token (token)) {
7777 uint8_t * t = (uint8_t *)(&token);
@@ -271,7 +271,7 @@ uint8_t HardwarePWM::freeChannelCount(void) const
271271}
272272
273273// returns true ONLY when (1) no PWM channel has a pin, and (2) the owner token is nullptr
274- bool HardwarePWM::takeOwnership (uintptr_t token)
274+ bool HardwarePWM::takeOwnership (uint32_t token)
275275{
276276 if (token == 0 ) {
277277 LOG_LV1 (" HwPWM" , " zero / nullptr is not a valid ownership token (attempted use in takeOwnership)" );
@@ -288,12 +288,12 @@ bool HardwarePWM::takeOwnership(uintptr_t token)
288288 if ( this ->enabled () ) return false ;
289289
290290 // Use C++11 atomic CAS operation
291- uintptr_t expectedValue = 0U ;
291+ uint32_t expectedValue = 0U ;
292292 return this ->_owner_token .compare_exchange_strong (expectedValue, token);
293293}
294294
295295// returns true ONLY when (1) no PWM channel has a pin attached, and (2) the owner token matches
296- bool HardwarePWM::releaseOwnership (uintptr_t token)
296+ bool HardwarePWM::releaseOwnership (uint32_t token)
297297{
298298 if (token == 0 ) {
299299 LOG_LV1 (" HwPWM" , " zero / nullptr is not a valid ownership token (attempted use in releaseOwnership)" );
0 commit comments