mirror of
https://github.com/espressif/openthread.git
synced 2026-09-13 04:30:08 +00:00
[clang-format] use AllowShortFunctionsOnASingleLine: All (#8502)
This commit updates `AllowShortFunctionsOnASingleLine` to `All` from `InlineOnly`.
This commit is contained in:
@@ -162,10 +162,7 @@ uint64_t platformGetNow(void)
|
||||
}
|
||||
#endif // defined(CLOCK_MONOTONIC_RAW) || defined(CLOCK_MONOTONIC)
|
||||
|
||||
uint32_t otPlatAlarmMilliGetNow(void)
|
||||
{
|
||||
return (uint32_t)(platformGetNow() / US_PER_MS);
|
||||
}
|
||||
uint32_t otPlatAlarmMilliGetNow(void) { return (uint32_t)(platformGetNow() / US_PER_MS); }
|
||||
|
||||
void otPlatAlarmMilliStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt)
|
||||
{
|
||||
@@ -182,10 +179,7 @@ void otPlatAlarmMilliStop(otInstance *aInstance)
|
||||
sIsMsRunning = false;
|
||||
}
|
||||
|
||||
uint32_t otPlatAlarmMicroGetNow(void)
|
||||
{
|
||||
return (uint32_t)platformGetNow();
|
||||
}
|
||||
uint32_t otPlatAlarmMicroGetNow(void) { return (uint32_t)platformGetNow(); }
|
||||
|
||||
void otPlatAlarmMicroStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt)
|
||||
{
|
||||
@@ -303,14 +297,8 @@ void platformAlarmProcess(otInstance *aInstance)
|
||||
#endif
|
||||
}
|
||||
|
||||
uint64_t otPlatTimeGet(void)
|
||||
{
|
||||
return platformGetNow();
|
||||
}
|
||||
uint64_t otPlatTimeGet(void) { return platformGetNow(); }
|
||||
|
||||
uint16_t otPlatTimeGetXtalAccuracy(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
uint16_t otPlatTimeGetXtalAccuracy(void) { return 0; }
|
||||
|
||||
#endif // OPENTHREAD_SIMULATION_VIRTUAL_TIME == 0
|
||||
|
||||
@@ -56,25 +56,13 @@ enum
|
||||
static otGpioMode sGpioMode = OT_GPIO_MODE_INPUT;
|
||||
static bool sGpioValue = false;
|
||||
|
||||
void otPlatDiagModeSet(bool aMode)
|
||||
{
|
||||
sDiagMode = aMode;
|
||||
}
|
||||
void otPlatDiagModeSet(bool aMode) { sDiagMode = aMode; }
|
||||
|
||||
bool otPlatDiagModeGet()
|
||||
{
|
||||
return sDiagMode;
|
||||
}
|
||||
bool otPlatDiagModeGet() { return sDiagMode; }
|
||||
|
||||
void otPlatDiagChannelSet(uint8_t aChannel)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aChannel);
|
||||
}
|
||||
void otPlatDiagChannelSet(uint8_t aChannel) { OT_UNUSED_VARIABLE(aChannel); }
|
||||
|
||||
void otPlatDiagTxPowerSet(int8_t aTxPower)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aTxPower);
|
||||
}
|
||||
void otPlatDiagTxPowerSet(int8_t aTxPower) { OT_UNUSED_VARIABLE(aTxPower); }
|
||||
|
||||
void otPlatDiagRadioReceived(otInstance *aInstance, otRadioFrame *aFrame, otError aError)
|
||||
{
|
||||
@@ -83,10 +71,7 @@ void otPlatDiagRadioReceived(otInstance *aInstance, otRadioFrame *aFrame, otErro
|
||||
OT_UNUSED_VARIABLE(aError);
|
||||
}
|
||||
|
||||
void otPlatDiagAlarmCallback(otInstance *aInstance)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
void otPlatDiagAlarmCallback(otInstance *aInstance) { OT_UNUSED_VARIABLE(aInstance); }
|
||||
|
||||
otError otPlatDiagGpioSet(uint32_t aGpio, bool aValue)
|
||||
{
|
||||
|
||||
@@ -185,10 +185,7 @@ static void NodeIdFilterDeny(uint16_t aNodeId)
|
||||
sDeniedNodeIdsBitVector[index / 8] |= 0x80 >> (index % 8);
|
||||
}
|
||||
|
||||
static void NodeIdFilterClear(void)
|
||||
{
|
||||
memset(sDeniedNodeIdsBitVector, 0, sizeof(sDeniedNodeIdsBitVector));
|
||||
}
|
||||
static void NodeIdFilterClear(void) { memset(sDeniedNodeIdsBitVector, 0, sizeof(sDeniedNodeIdsBitVector)); }
|
||||
|
||||
otError ProcessNodeIdFilter(void *aContext, uint8_t aArgsLength, char *aArgs[])
|
||||
{
|
||||
@@ -237,10 +234,7 @@ otError ProcessNodeIdFilter(void *aContext, uint8_t aArgsLength, char *aArgs[])
|
||||
}
|
||||
#endif // OPENTHREAD_SIMULATION_VIRTUAL_TIME == 0
|
||||
|
||||
static bool IsTimeAfterOrEqual(uint32_t aTimeA, uint32_t aTimeB)
|
||||
{
|
||||
return (aTimeA - aTimeB) < (1U << 31);
|
||||
}
|
||||
static bool IsTimeAfterOrEqual(uint32_t aTimeA, uint32_t aTimeB) { return (aTimeA - aTimeB) < (1U << 31); }
|
||||
|
||||
static void ReverseExtAddress(otExtAddress *aReversed, const otExtAddress *aOrigin)
|
||||
{
|
||||
@@ -794,10 +788,7 @@ exit:
|
||||
return;
|
||||
}
|
||||
|
||||
bool platformRadioIsTransmitPending(void)
|
||||
{
|
||||
return sState == OT_RADIO_STATE_TRANSMIT && !sTxWait;
|
||||
}
|
||||
bool platformRadioIsTransmitPending(void) { return sState == OT_RADIO_STATE_TRANSMIT && !sTxWait; }
|
||||
|
||||
#if OPENTHREAD_SIMULATION_VIRTUAL_TIME
|
||||
void platformRadioReceive(otInstance *aInstance, uint8_t *aBuf, uint16_t aBufLength)
|
||||
|
||||
@@ -52,9 +52,7 @@ otError otPlatSpiSlaveEnable(otPlatSpiSlaveTransactionCompleteCallback aComplete
|
||||
return OT_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
void otPlatSpiSlaveDisable(void)
|
||||
{
|
||||
}
|
||||
void otPlatSpiSlaveDisable(void) {}
|
||||
|
||||
otError otPlatSpiSlavePrepareTransaction(uint8_t *aOutputBuf,
|
||||
uint16_t aOutputBufLen,
|
||||
@@ -73,9 +71,7 @@ otError otPlatSpiSlavePrepareTransaction(uint8_t *aOutputBuf,
|
||||
|
||||
// Uart
|
||||
|
||||
void otPlatUartSendDone(void)
|
||||
{
|
||||
}
|
||||
void otPlatUartSendDone(void) {}
|
||||
|
||||
void otPlatUartReceived(const uint8_t *aBuf, uint16_t aBufLength)
|
||||
{
|
||||
|
||||
@@ -176,10 +176,7 @@ void otSysInit(int aArgCount, char *aArgVector[])
|
||||
platformRandomInit();
|
||||
}
|
||||
|
||||
bool otSysPseudoResetWasRequested(void)
|
||||
{
|
||||
return gPlatformPseudoResetWasRequested;
|
||||
}
|
||||
bool otSysPseudoResetWasRequested(void) { return gPlatformPseudoResetWasRequested; }
|
||||
|
||||
void otSysDeinit(void)
|
||||
{
|
||||
|
||||
@@ -419,10 +419,7 @@ void platformTrelInit(uint32_t aSpeedUpFactor)
|
||||
OT_UNUSED_VARIABLE(aSpeedUpFactor);
|
||||
}
|
||||
|
||||
void platformTrelDeinit(void)
|
||||
{
|
||||
deinitFds();
|
||||
}
|
||||
void platformTrelDeinit(void) { deinitFds(); }
|
||||
|
||||
void platformTrelUpdateFdSet(fd_set *aReadFdSet, fd_set *aWriteFdSet, struct timeval *aTimeout, int *aMaxFd)
|
||||
{
|
||||
|
||||
@@ -54,15 +54,9 @@ static int s_out_fd;
|
||||
static struct termios original_stdin_termios;
|
||||
static struct termios original_stdout_termios;
|
||||
|
||||
static void restore_stdin_termios(void)
|
||||
{
|
||||
tcsetattr(s_in_fd, TCSAFLUSH, &original_stdin_termios);
|
||||
}
|
||||
static void restore_stdin_termios(void) { tcsetattr(s_in_fd, TCSAFLUSH, &original_stdin_termios); }
|
||||
|
||||
static void restore_stdout_termios(void)
|
||||
{
|
||||
tcsetattr(s_out_fd, TCSAFLUSH, &original_stdout_termios);
|
||||
}
|
||||
static void restore_stdout_termios(void) { tcsetattr(s_out_fd, TCSAFLUSH, &original_stdout_termios); }
|
||||
|
||||
void platformUartRestore(void)
|
||||
{
|
||||
|
||||
@@ -55,20 +55,11 @@ void platformAlarmInit(uint32_t aSpeedUpFactor)
|
||||
sNow = 0;
|
||||
}
|
||||
|
||||
uint64_t platformAlarmGetNow(void)
|
||||
{
|
||||
return sNow;
|
||||
}
|
||||
uint64_t platformAlarmGetNow(void) { return sNow; }
|
||||
|
||||
void platformAlarmAdvanceNow(uint64_t aDelta)
|
||||
{
|
||||
sNow += aDelta;
|
||||
}
|
||||
void platformAlarmAdvanceNow(uint64_t aDelta) { sNow += aDelta; }
|
||||
|
||||
uint32_t otPlatAlarmMilliGetNow(void)
|
||||
{
|
||||
return (uint32_t)(sNow / US_PER_MS);
|
||||
}
|
||||
uint32_t otPlatAlarmMilliGetNow(void) { return (uint32_t)(sNow / US_PER_MS); }
|
||||
|
||||
void otPlatAlarmMilliStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt)
|
||||
{
|
||||
@@ -85,10 +76,7 @@ void otPlatAlarmMilliStop(otInstance *aInstance)
|
||||
sIsMsRunning = false;
|
||||
}
|
||||
|
||||
uint32_t otPlatAlarmMicroGetNow(void)
|
||||
{
|
||||
return (uint32_t)sNow;
|
||||
}
|
||||
uint32_t otPlatAlarmMicroGetNow(void) { return (uint32_t)sNow; }
|
||||
|
||||
void otPlatAlarmMicroStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt)
|
||||
{
|
||||
@@ -186,16 +174,10 @@ void platformAlarmProcess(otInstance *aInstance)
|
||||
#endif // OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE
|
||||
}
|
||||
|
||||
uint64_t otPlatTimeGet(void)
|
||||
{
|
||||
return platformAlarmGetNow();
|
||||
}
|
||||
uint64_t otPlatTimeGet(void) { return platformAlarmGetNow(); }
|
||||
|
||||
#if OPENTHREAD_CONFIG_TIME_SYNC_ENABLE
|
||||
uint16_t otPlatTimeGetXtalAccuracy(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
uint16_t otPlatTimeGetXtalAccuracy(void) { return 0; }
|
||||
#endif
|
||||
|
||||
#endif // OPENTHREAD_SIMULATION_VIRTUAL_TIME
|
||||
|
||||
@@ -136,19 +136,11 @@ static void platformSendSleepEvent(void)
|
||||
}
|
||||
|
||||
#if OPENTHREAD_SIMULATION_VIRTUAL_TIME_UART
|
||||
void platformUartRestore(void)
|
||||
{
|
||||
}
|
||||
void platformUartRestore(void) {}
|
||||
|
||||
otError otPlatUartEnable(void)
|
||||
{
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
otError otPlatUartEnable(void) { return OT_ERROR_NONE; }
|
||||
|
||||
otError otPlatUartDisable(void)
|
||||
{
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
otError otPlatUartDisable(void) { return OT_ERROR_NONE; }
|
||||
|
||||
otError otPlatUartSend(const uint8_t *aData, uint16_t aLength)
|
||||
{
|
||||
@@ -168,10 +160,7 @@ otError otPlatUartSend(const uint8_t *aData, uint16_t aLength)
|
||||
return error;
|
||||
}
|
||||
|
||||
otError otPlatUartFlush(void)
|
||||
{
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
otError otPlatUartFlush(void) { return OT_ERROR_NONE; }
|
||||
#endif // OPENTHREAD_SIMULATION_VIRTUAL_TIME_UART
|
||||
|
||||
static void socket_init(void)
|
||||
@@ -242,15 +231,9 @@ void otSysInit(int argc, char *argv[])
|
||||
signal(SIGHUP, &handleSignal);
|
||||
}
|
||||
|
||||
bool otSysPseudoResetWasRequested(void)
|
||||
{
|
||||
return gPlatformPseudoResetWasRequested;
|
||||
}
|
||||
bool otSysPseudoResetWasRequested(void) { return gPlatformPseudoResetWasRequested; }
|
||||
|
||||
void otSysDeinit(void)
|
||||
{
|
||||
close(sSockFd);
|
||||
}
|
||||
void otSysDeinit(void) { close(sSockFd); }
|
||||
|
||||
void otSysProcessDrivers(otInstance *aInstance)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user