-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SITL: add ENABLED defines for remaining simulated I2C devices #28848
SITL: add ENABLED defines for remaining simulated I2C devices #28848
Conversation
libraries/SITL/SIM_Airspeed_DLVR.h
Outdated
@@ -2,6 +2,14 @@ | |||
|
|||
#include "SIM_I2CDevice.h" | |||
|
|||
#include <AP_HAL/AP_HAL_Boards.h> | |||
|
|||
#ifndef AP_SIM_AIRSPEEDDLVR_ENABLED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should go in SIM_config.h
Also, please add underscores in each of them:
#ifndef AP_SIM_AIRSPEEDDLVR_ENABLED | |
#ifndef AP_SIM_AIRSPEED_DLVR_ENABLED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review. Updated in 92b8e86
a758871
to
035d4e4
Compare
Signed-off-by: Rhys Mainwaring <[email protected]>
035d4e4
to
92b8e86
Compare
@@ -1,5 +1,7 @@ | |||
#include "SIM_Temperature_TSYS01.h" | |||
|
|||
#if AP_SIM_TEMPERATURE_TSYS01_ENABLED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our pattern is to include SIM_config.h
and then check this, including the .h corresponding to the .cpp after that check has passed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in follow up here: #28871
Merged, thanks! |
Adds conditional compilation defines for the remainder of the I2C sensors included in
SIM_I2C.cpp
.Motivation
Aside from consistency, this reduces DRAM use for SIM on HW (esp. esp32empty and esp32s3empty where RAM limits are causing WiFi to not initialise correctly).
Before:
After:
See also: