Skip to content

Commit

Permalink
HAL_SITL: fixed unbuffered UART writes in SITL
Browse files Browse the repository at this point in the history
this was causing PPP to slow down by about 1000x due to duplicate
writes
  • Loading branch information
tridge committed Dec 30, 2023
1 parent 84b8f3a commit d128d84
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions libraries/AP_HAL_SITL/UARTDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,7 @@ uint16_t UARTDriver::read_from_async_csv(uint8_t *buffer, uint16_t space)

void UARTDriver::handle_writing_from_writebuffer_to_device()
{
WITH_SEMAPHORE(write_mtx);
if (!_connected) {
_check_reconnect();
return;
Expand Down
2 changes: 2 additions & 0 deletions libraries/AP_HAL_SITL/UARTDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ class HALSITL::UARTDriver : public AP_HAL::UARTDriver {
uint32_t last_read_tick_us;
uint32_t last_write_tick_us;

HAL_Semaphore write_mtx;

SITL::SerialDevice *_sim_serial_device;

struct {
Expand Down

0 comments on commit d128d84

Please sign in to comment.