[spinel] fix compiling issue of enum multiplication (#9649)

A compiling issue occurred (based on gcc 9.4.0) beacuse the
multiplication of different enum types. So it is a good idea to define
the `kUsPerMs` as `constexpr` constants instead of `enum`.
This commit is contained in:
gytxxsy
2023-11-28 09:31:03 -08:00
committed by GitHub
parent c805678511
commit f859987ce6
+3 -5
View File
@@ -935,11 +935,9 @@ private:
kStateTransmitDone, ///< Radio indicated frame transmission is done.
};
enum
{
kUsPerMs = 1000, ///< Microseconds per millisecond.
kTxWaitUs = 5000000, ///< Maximum time of waiting for `TransmitDone` event, in microseconds.
};
static constexpr uint32_t kUsPerMs = 1000; ///< Microseconds per millisecond.
static constexpr uint64_t kTxWaitUs =
5000000; ///< Maximum time of waiting for `TransmitDone` event, in microseconds.
typedef otError (RadioSpinel::*ResponseHandler)(const uint8_t *aBuffer, uint16_t aLength);