Browse Source

HAL_ChibiOS: use uint32_t for bit timing in passthru

we should not use systime_t as it may be 16 bit
c415-sdk
Andrew Tridgell 4 years ago
parent
commit
744a2fe535
  1. 2
      libraries/AP_HAL_ChibiOS/RCOutput.cpp
  2. 6
      libraries/AP_HAL_ChibiOS/RCOutput.h

2
libraries/AP_HAL_ChibiOS/RCOutput.cpp

@ -1565,7 +1565,7 @@ bool RCOutput::serial_write_bytes(const uint8_t *bytes, uint16_t len)
*/ */
void RCOutput::serial_bit_irq(void) void RCOutput::serial_bit_irq(void)
{ {
systime_t now = AP_HAL::micros(); uint32_t now = AP_HAL::micros();
uint8_t bit = palReadLine(irq.line); uint8_t bit = palReadLine(irq.line);
bool send_signal = false; bool send_signal = false;

6
libraries/AP_HAL_ChibiOS/RCOutput.h

@ -350,7 +350,7 @@ private:
ioline_t line; ioline_t line;
// time the current byte started // time the current byte started
systime_t byte_start_tick; uint32_t byte_start_tick;
// number of bits we have read in this byte // number of bits we have read in this byte
uint8_t nbits; uint8_t nbits;
@ -361,8 +361,8 @@ private:
// value of completed byte (includes start and stop bits) // value of completed byte (includes start and stop bits)
uint16_t byteval; uint16_t byteval;
// expected time per bit in system ticks // expected time per bit in micros
systime_t bit_time_tick; uint32_t bit_time_tick;
// the bit value of the last bit received // the bit value of the last bit received
uint8_t last_bit; uint8_t last_bit;

Loading…
Cancel
Save