SPI: Make some validation failures give more useful messages. (#6413)

This commit is contained in:
Clyde Stubbs 2024-03-21 14:25:11 +11:00 committed by GitHub
parent 1d6f245ced
commit d0ced3471e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 39 additions and 24 deletions

View file

@ -268,6 +268,9 @@ SPI_SCHEMA = cv.All(
*sum(get_hw_interface_list(), ["software", "hardware", "any"]), *sum(get_hw_interface_list(), ["software", "hardware", "any"]),
lower=True, lower=True,
), ),
cv.Optional(CONF_DATA_PINS): cv.invalid(
"'data_pins' should be used with 'type: quad' only"
),
} }
), ),
cv.has_at_least_one_key(CONF_MISO_PIN, CONF_MOSI_PIN), cv.has_at_least_one_key(CONF_MISO_PIN, CONF_MOSI_PIN),
@ -287,6 +290,12 @@ SPI_QUAD_SCHEMA = cv.All(
*sum(get_hw_interface_list(), ["hardware"]), *sum(get_hw_interface_list(), ["hardware"]),
lower=True, lower=True,
), ),
cv.Optional(CONF_MISO_PIN): cv.invalid(
"'miso_pin' should not be used with quad SPI"
),
cv.Optional(CONF_MOSI_PIN): cv.invalid(
"'mosi_pin' should not be used with quad SPI"
),
} }
), ),
cv.only_on([PLATFORM_ESP32]), cv.only_on([PLATFORM_ESP32]),

View file

@ -23,10 +23,11 @@ touchscreen:
display: xpt_display display: xpt_display
update_interval: 50ms update_interval: 50ms
threshold: 400 threshold: 400
calibration_x_min: 3860 calibration:
calibration_x_max: 280 x_min: 3860
calibration_y_min: 340 x_max: 280
calibration_y_max: 3860 y_min: 340
y_max: 3860
on_touch: on_touch:
- logger.log: - logger.log:
format: Touch at (%d, %d) format: Touch at (%d, %d)

View file

@ -23,10 +23,11 @@ touchscreen:
display: xpt_display display: xpt_display
update_interval: 50ms update_interval: 50ms
threshold: 400 threshold: 400
calibration_x_min: 3860 calibration:
calibration_x_max: 280 x_min: 3860
calibration_y_min: 340 x_max: 280
calibration_y_max: 3860 y_min: 340
y_max: 3860
on_touch: on_touch:
- logger.log: - logger.log:
format: Touch at (%d, %d) format: Touch at (%d, %d)

View file

@ -23,10 +23,11 @@ touchscreen:
display: xpt_display display: xpt_display
update_interval: 50ms update_interval: 50ms
threshold: 400 threshold: 400
calibration_x_min: 3860 calibration:
calibration_x_max: 280 x_min: 3860
calibration_y_min: 340 x_max: 280
calibration_y_max: 3860 y_min: 340
y_max: 3860
on_touch: on_touch:
- logger.log: - logger.log:
format: Touch at (%d, %d) format: Touch at (%d, %d)

View file

@ -23,10 +23,11 @@ touchscreen:
display: xpt_display display: xpt_display
update_interval: 50ms update_interval: 50ms
threshold: 400 threshold: 400
calibration_x_min: 3860 calibration:
calibration_x_max: 280 x_min: 3860
calibration_y_min: 340 x_max: 280
calibration_y_max: 3860 y_min: 340
y_max: 3860
on_touch: on_touch:
- logger.log: - logger.log:
format: Touch at (%d, %d) format: Touch at (%d, %d)

View file

@ -23,10 +23,11 @@ touchscreen:
display: xpt_display display: xpt_display
update_interval: 50ms update_interval: 50ms
threshold: 400 threshold: 400
calibration_x_min: 3860 calibration:
calibration_x_max: 280 x_min: 3860
calibration_y_min: 340 x_max: 280
calibration_y_max: 3860 y_min: 340
y_max: 3860
on_touch: on_touch:
- logger.log: - logger.log:
format: Touch at (%d, %d) format: Touch at (%d, %d)

View file

@ -23,10 +23,11 @@ touchscreen:
display: xpt_display display: xpt_display
update_interval: 50ms update_interval: 50ms
threshold: 400 threshold: 400
calibration_x_min: 3860 calibration:
calibration_x_max: 280 x_min: 3860
calibration_y_min: 340 x_max: 280
calibration_y_max: 3860 y_min: 340
y_max: 3860
on_touch: on_touch:
- logger.log: - logger.log:
format: Touch at (%d, %d) format: Touch at (%d, %d)