mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-28 02:11:43 +00:00
[ci] Upgrade to clang-format and clang-tidy 14 (NFC) (#4347)
This commit is contained in:
@@ -394,9 +394,8 @@ void HAL_SetCTREPCMOneShotDuration(HAL_CTREPCMHandle handle, int32_t index,
|
||||
}
|
||||
|
||||
std::scoped_lock lock{pcm->lock};
|
||||
pcm->oneShot.sol10MsPerUnit[index] =
|
||||
(std::min)(static_cast<uint32_t>(durMs) / 10,
|
||||
static_cast<uint32_t>(0xFF));
|
||||
pcm->oneShot.sol10MsPerUnit[index] = (std::min)(
|
||||
static_cast<uint32_t>(durMs) / 10, static_cast<uint32_t>(0xFF));
|
||||
HAL_WriteCANPacketRepeating(pcm->canHandle, pcm->oneShot.sol10MsPerUnit, 8,
|
||||
Control3, SendPeriod, status);
|
||||
}
|
||||
|
||||
@@ -148,22 +148,24 @@ class SimDataValue final : public impl::SimDataValueBase<T, MakeValue> {
|
||||
* @param DATA the backing data array
|
||||
* @param LOWERNAME the lowercase name of the backing data variable
|
||||
*/
|
||||
#define HAL_SIMDATAVALUE_DEFINE_CAPI(TYPE, NS, CAPINAME, DATA, LOWERNAME) \
|
||||
int32_t NS##_Register##CAPINAME##Callback( \
|
||||
int32_t index, HAL_NotifyCallback callback, void* param, \
|
||||
HAL_Bool initialNotify) { \
|
||||
return DATA[index].LOWERNAME.RegisterCallback(callback, param, \
|
||||
initialNotify); \
|
||||
} \
|
||||
\
|
||||
void NS##_Cancel##CAPINAME##Callback(int32_t index, int32_t uid) { \
|
||||
DATA[index].LOWERNAME.CancelCallback(uid); \
|
||||
} \
|
||||
\
|
||||
TYPE NS##_Get##CAPINAME(int32_t index) { return DATA[index].LOWERNAME; } \
|
||||
\
|
||||
void NS##_Set##CAPINAME(int32_t index, TYPE LOWERNAME) { \
|
||||
DATA[index].LOWERNAME = LOWERNAME; \
|
||||
#define HAL_SIMDATAVALUE_DEFINE_CAPI(TYPE, NS, CAPINAME, DATA, LOWERNAME) \
|
||||
int32_t NS##_Register##CAPINAME##Callback( \
|
||||
int32_t index, HAL_NotifyCallback callback, void* param, \
|
||||
HAL_Bool initialNotify) { \
|
||||
return DATA[index].LOWERNAME.RegisterCallback(callback, param, \
|
||||
initialNotify); \
|
||||
} \
|
||||
\
|
||||
void NS##_Cancel##CAPINAME##Callback(int32_t index, int32_t uid) { \
|
||||
DATA[index].LOWERNAME.CancelCallback(uid); \
|
||||
} \
|
||||
\
|
||||
TYPE NS##_Get##CAPINAME(int32_t index) { \
|
||||
return DATA[index].LOWERNAME; \
|
||||
} \
|
||||
\
|
||||
void NS##_Set##CAPINAME(int32_t index, TYPE LOWERNAME) { \
|
||||
DATA[index].LOWERNAME = LOWERNAME; \
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -232,9 +234,13 @@ class SimDataValue final : public impl::SimDataValueBase<T, MakeValue> {
|
||||
DATA->LOWERNAME.CancelCallback(uid); \
|
||||
} \
|
||||
\
|
||||
TYPE NS##_Get##CAPINAME(void) { return DATA->LOWERNAME; } \
|
||||
TYPE NS##_Get##CAPINAME(void) { \
|
||||
return DATA->LOWERNAME; \
|
||||
} \
|
||||
\
|
||||
void NS##_Set##CAPINAME(TYPE LOWERNAME) { DATA->LOWERNAME = LOWERNAME; }
|
||||
void NS##_Set##CAPINAME(TYPE LOWERNAME) { \
|
||||
DATA->LOWERNAME = LOWERNAME; \
|
||||
}
|
||||
|
||||
/**
|
||||
* Define a stub standard C API for simulation data.
|
||||
@@ -261,7 +267,9 @@ class SimDataValue final : public impl::SimDataValueBase<T, MakeValue> {
|
||||
\
|
||||
void NS##_Cancel##CAPINAME##Callback(int32_t index, int32_t uid) {} \
|
||||
\
|
||||
TYPE NS##_Get##CAPINAME(int32_t index) { return RETURN; } \
|
||||
TYPE NS##_Get##CAPINAME(int32_t index) { \
|
||||
return RETURN; \
|
||||
} \
|
||||
\
|
||||
void NS##_Set##CAPINAME(int32_t index, TYPE) {}
|
||||
|
||||
@@ -281,18 +289,20 @@ class SimDataValue final : public impl::SimDataValueBase<T, MakeValue> {
|
||||
* @param CAPINAME the C API name (usually first letter capitalized)
|
||||
* @param RETURN what to return from the Get function
|
||||
*/
|
||||
#define HAL_SIMDATAVALUE_STUB_CAPI_CHANNEL(TYPE, NS, CAPINAME, RETURN) \
|
||||
int32_t NS##_Register##CAPINAME##Callback( \
|
||||
int32_t index, int32_t channel, HAL_NotifyCallback callback, \
|
||||
void* param, HAL_Bool initialNotify) { \
|
||||
return 0; \
|
||||
} \
|
||||
\
|
||||
void NS##_Cancel##CAPINAME##Callback(int32_t index, int32_t channel, \
|
||||
int32_t uid) {} \
|
||||
\
|
||||
TYPE NS##_Get##CAPINAME(int32_t index, int32_t channel) { return RETURN; } \
|
||||
\
|
||||
#define HAL_SIMDATAVALUE_STUB_CAPI_CHANNEL(TYPE, NS, CAPINAME, RETURN) \
|
||||
int32_t NS##_Register##CAPINAME##Callback( \
|
||||
int32_t index, int32_t channel, HAL_NotifyCallback callback, \
|
||||
void* param, HAL_Bool initialNotify) { \
|
||||
return 0; \
|
||||
} \
|
||||
\
|
||||
void NS##_Cancel##CAPINAME##Callback(int32_t index, int32_t channel, \
|
||||
int32_t uid) {} \
|
||||
\
|
||||
TYPE NS##_Get##CAPINAME(int32_t index, int32_t channel) { \
|
||||
return RETURN; \
|
||||
} \
|
||||
\
|
||||
void NS##_Set##CAPINAME(int32_t index, int32_t channel, TYPE) {}
|
||||
|
||||
/**
|
||||
@@ -318,7 +328,9 @@ class SimDataValue final : public impl::SimDataValueBase<T, MakeValue> {
|
||||
\
|
||||
void NS##_Cancel##CAPINAME##Callback(int32_t uid) {} \
|
||||
\
|
||||
TYPE NS##_Get##CAPINAME(void) { return RETURN; } \
|
||||
TYPE NS##_Get##CAPINAME(void) { \
|
||||
return RETURN; \
|
||||
} \
|
||||
\
|
||||
void NS##_Set##CAPINAME(TYPE) {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user