Skip to content

Commit c7fe618

Browse files
committed
AP_HAL_SITL: move ctsrts handling into common SITL_State_Common base class
1 parent 1c5c80d commit c7fe618

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

libraries/AP_HAL_SITL/SITL_Periph_State.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ class HALSITL::SITL_State : public SITL_State_Common {
5252
public:
5353
void init(int argc, char * const argv[]) override;
5454

55-
bool use_rtscts(void) const {
56-
return _use_rtscts;
57-
}
58-
5955
uint16_t base_port(void) const {
6056
return _base_port;
6157
}
@@ -80,7 +76,6 @@ class HALSITL::SITL_State : public SITL_State_Common {
8076
private:
8177

8278
void wait_clock(uint64_t wait_time_usec);
83-
bool _use_rtscts;
8479
uint16_t _base_port;
8580

8681
const char *defaults_path = HAL_PARAM_DEFAULTS_PATH;

libraries/AP_HAL_SITL/SITL_State.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ class HALSITL::SITL_State : public SITL_State_Common {
2525
return _base_port;
2626
}
2727

28-
bool use_rtscts(void) const {
29-
return _use_rtscts;
30-
}
31-
3228
// paths for UART devices
3329
const char *_serial_path[9] {
3430
"tcp:0:wait",
@@ -89,7 +85,6 @@ class HALSITL::SITL_State : public SITL_State_Common {
8985

9086
bool _synthetic_clock_mode;
9187

92-
bool _use_rtscts;
9388
bool _use_fg_view;
9489

9590
const char *_fg_address;

libraries/AP_HAL_SITL/SITL_State_common.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ class HALSITL::SITL_State_Common {
100100
float voltage2_pin_voltage; // pin 15
101101
float current2_pin_voltage; // pin 14
102102

103+
bool use_rtscts(void) const {
104+
return _use_rtscts;
105+
}
106+
103107
uint16_t pwm_input[SITL_RC_INPUT_CHANNELS];
104108
bool new_rc_input;
105109
uint16_t pwm_output[SITL_NUM_CHANNELS];
@@ -258,6 +262,8 @@ class HALSITL::SITL_State_Common {
258262
SITL::SIM *_sitl;
259263

260264
void update_voltage_current(struct sitl_input &input, float throttle);
265+
266+
bool _use_rtscts;
261267
};
262268

263269
#endif // CONFIG_HAL_BOARD == HAL_BOARD_SITL

0 commit comments

Comments
 (0)