mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
[hal] Expose CAN timestamp base clock (#5357)
This commit is contained in:
@@ -10,8 +10,11 @@
|
||||
|
||||
namespace frc {
|
||||
struct CANData {
|
||||
/** Contents of the CAN packet. */
|
||||
uint8_t data[8];
|
||||
/** Length of packet in bytes. */
|
||||
int32_t length;
|
||||
/** CAN frame timestamp in milliseconds. */
|
||||
uint64_t timestamp;
|
||||
};
|
||||
|
||||
@@ -158,6 +161,15 @@ class CAN {
|
||||
*/
|
||||
bool ReadPacketTimeout(int apiId, int timeoutMs, CANData* data);
|
||||
|
||||
/**
|
||||
* Reads the current value of the millisecond-resolution timer that CANData
|
||||
* timestamps are based on
|
||||
*
|
||||
* @return Current value of timer used as a base time for CANData timestamps
|
||||
* in milliseconds
|
||||
*/
|
||||
static uint64_t GetTimestampBaseTime();
|
||||
|
||||
static constexpr HAL_CANManufacturer kTeamManufacturer = HAL_CAN_Man_kTeamUse;
|
||||
static constexpr HAL_CANDeviceType kTeamDeviceType =
|
||||
HAL_CAN_Dev_kMiscellaneous;
|
||||
|
||||
Reference in New Issue
Block a user