refactor: centralize shade GPIO initialization and board guards

Use one initialization method for saved configuration and JSON updates. Reject the complete output assignment when any pin belongs to integrated board hardware, retaining separate UI validation and runtime output guards. Exercise production GPIO initialization on generic and Plus profiles.
This commit is contained in:
R. Sid Shaytay 2026-11-06 12:51:36 -08:00
parent a5afcfacea
commit d4c13d5134
6 changed files with 41 additions and 14 deletions

View file

@ -11,9 +11,15 @@ sources=("$repo/tests/board-profile/board-profile-test.cpp" "$repo/src/BoardProf
"$scratch/lilygo-test"
"$compiler" "${common[@]}" "${sources[@]}" -o "$scratch/generic-test"
"$scratch/generic-test"
"$compiler" "${common[@]}" -DESPSOMFY_LILYGO_T_EMBED_CC1101_PLUS -DCONFIG_IDF_TARGET_ESP32S3 \
"$repo/tests/board-profile/shade-gpio-test.cpp" "$repo/src/BoardProfile.cpp" -o "$scratch/shade-gpio-test"
"$scratch/shade-gpio-test"
for profile in generic lilygo; do
flags=()
if [[ "$profile" == lilygo ]]; then
flags=(-DESPSOMFY_LILYGO_T_EMBED_CC1101_PLUS -DCONFIG_IDF_TARGET_ESP32S3)
fi
"$compiler" "${common[@]}" "${flags[@]}" \
"$repo/tests/board-profile/shade-gpio-test.cpp" "$repo/src/BoardProfile.cpp" -o "$scratch/shade-gpio-$profile"
"$scratch/shade-gpio-$profile"
done
if "$compiler" "${common[@]}" -DESPSOMFY_LILYGO_T_EMBED_CC1101_PLUS \
"${sources[@]}" -o "$scratch/wrong-target" > "$scratch/wrong-target.log" 2>&1; then
echo 'LILYGO profile incorrectly accepted a non-S3 target' >&2