Browse Source

HAL_ChibiOS: fixed 32/64 micros bug in CAN select()

zr-v5.1
Andrew Tridgell 4 years ago
parent
commit
353eca79b6
  1. 4
      libraries/AP_HAL_ChibiOS/CANFDIface.cpp
  2. 4
      libraries/AP_HAL_ChibiOS/CanIface.cpp

4
libraries/AP_HAL_ChibiOS/CANFDIface.cpp

@ -994,7 +994,7 @@ bool CANIface::select(bool &read, bool &write, @@ -994,7 +994,7 @@ bool CANIface::select(bool &read, bool &write,
{
const bool in_read = read;
const bool in_write= write;
uint64_t time = AP_HAL::micros();
uint64_t time = AP_HAL::micros64();
if (!read && !write) {
//invalid request
@ -1018,7 +1018,7 @@ bool CANIface::select(bool &read, bool &write, @@ -1018,7 +1018,7 @@ bool CANIface::select(bool &read, bool &write,
if ((read && in_read) || (write && in_write)) {
return true;
}
time = AP_HAL::micros();
time = AP_HAL::micros64();
}
return false;
}

4
libraries/AP_HAL_ChibiOS/CanIface.cpp

@ -711,7 +711,7 @@ bool CANIface::select(bool &read, bool &write, @@ -711,7 +711,7 @@ bool CANIface::select(bool &read, bool &write,
{
const bool in_read = read;
const bool in_write= write;
uint64_t time = AP_HAL::micros();
uint64_t time = AP_HAL::micros64();
if (!read && !write) {
//invalid request
@ -737,7 +737,7 @@ bool CANIface::select(bool &read, bool &write, @@ -737,7 +737,7 @@ bool CANIface::select(bool &read, bool &write,
if ((read && in_read) || (write && in_write)) {
return true;
}
time = AP_HAL::micros();
time = AP_HAL::micros64();
}
#endif // #if !defined(HAL_BUILD_AP_PERIPH) && !defined(HAL_BOOTLOADER_BUILD)
return true;

Loading…
Cancel
Save