Skip to content

Commit

Permalink
AP_DroneCAN: use 32 bit timeout for write_aux_frame
Browse files Browse the repository at this point in the history
Saves a handful of bytes. 71 minutes ought to be enough for anybody!
  • Loading branch information
tpwrules committed Oct 15, 2024
1 parent c561fcd commit a8577ef
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion libraries/AP_DroneCAN/AP_Canard_iface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ bool CanardInterface::add_11bit_driver(CANSensor *sensor)
}

// handler for outgoing frames for auxillary drivers
bool CanardInterface::write_aux_frame(AP_HAL::CANFrame &out_frame, const uint64_t timeout_us)
bool CanardInterface::write_aux_frame(AP_HAL::CANFrame &out_frame, const uint32_t timeout_us)
{
const uint64_t tx_deadline_us = AP_HAL::micros64() + timeout_us;
bool ret = false;
Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_DroneCAN/AP_Canard_iface.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class CanardInterface : public Canard::Interface {
bool add_11bit_driver(CANSensor *sensor);

// handler for outgoing frames for auxillary drivers
bool write_aux_frame(AP_HAL::CANFrame &out_frame, const uint64_t timeout_us);
bool write_aux_frame(AP_HAL::CANFrame &out_frame, const uint32_t timeout_us);

#if AP_TEST_DRONECAN_DRIVERS
static CanardInterface& get_test_iface() { return test_iface; }
Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_DroneCAN/AP_DroneCAN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1900,7 +1900,7 @@ bool AP_DroneCAN::add_11bit_driver(CANSensor *sensor)
}

// handler for outgoing frames for auxillary drivers
bool AP_DroneCAN::write_aux_frame(AP_HAL::CANFrame &out_frame, const uint64_t timeout_us)
bool AP_DroneCAN::write_aux_frame(AP_HAL::CANFrame &out_frame, const uint32_t timeout_us)
{
if (out_frame.isExtended()) {
// don't allow extended frames to be sent by auxillary driver
Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_DroneCAN/AP_DroneCAN.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class AP_DroneCAN : public AP_CANDriver, public AP_ESC_Telem_Backend {
bool add_11bit_driver(CANSensor *sensor) override;

// handler for outgoing frames for auxillary drivers
bool write_aux_frame(AP_HAL::CANFrame &out_frame, const uint64_t timeout_us) override;
bool write_aux_frame(AP_HAL::CANFrame &out_frame, const uint32_t timeout_us) override;

uint8_t get_driver_index() const { return _driver_index; }

Expand Down

0 comments on commit a8577ef

Please sign in to comment.