diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index 84213f751cb705..4f3ed0501f274b 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -63,6 +63,15 @@ jobs: out/telink-tlsr9518adk80d-light/zephyr/zephyr.elf \ /tmp/bloat_reports/ + - name: Build example Telink Light Switch App + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py --no-log-timestamps --target-glob 'telink-*' build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + telink tlsr9518adk80d light-switch-app \ + out/telink-tlsr9518adk80d-light-switch/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + - name: Uploading Size Reports uses: actions/upload-artifact@v2 if: ${{ !env.ACT }} diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 4226a56b0dc7c8..9f34c08e27a6af 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -374,6 +374,7 @@ "nrf-nrf5340-shell", "qpg-qpg6100-lock", "telink-tlsr9518adk80d-light", + "telink-tlsr9518adk80d-light-switch", "tizen-arm-light" ] } diff --git a/examples/light-switch-app/telink/src/ZclCallbacks.cpp b/examples/light-switch-app/telink/src/ZclCallbacks.cpp index 8bc3f3c11c4d4f..9aa6ef099af151 100755 --- a/examples/light-switch-app/telink/src/ZclCallbacks.cpp +++ b/examples/light-switch-app/telink/src/ZclCallbacks.cpp @@ -36,14 +36,14 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & if (clusterId == OnOffSwitchConfiguration::Id) { ChipLogProgress( - Zcl, "OnOff Switch Configuration attribute ID: " ChipLogFormatMEI " Type: %u Value: %" PRIu16 ", length %" PRIu16, + Zcl, "OnOff Switch Configuration attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", ChipLogValueMEI(attributeId), type, *value, size); // WIP Apply attribute change to Light } else if (clusterId == Identify::Id) { - ChipLogProgress(Zcl, "Identify attribute ID: " ChipLogFormatMEI " Type: %u Value: %" PRIu16 ", length %" PRIu16, + ChipLogProgress(Zcl, "Identify attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", ChipLogValueMEI(attributeId), type, *value, size); } } diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index 768469f030d663..b24dc1de3c8f82 100644 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -582,6 +582,8 @@ def IMXTargets(): # Simple targets added one by one ALL.append(Target('telink-tlsr9518adk80d-light', TelinkBuilder, board=TelinkBoard.TLSR9518ADK80D, app=TelinkApp.LIGHT)) +ALL.append(Target('telink-tlsr9518adk80d-light-switch', TelinkBuilder, + board=TelinkBoard.TLSR9518ADK80D, app=TelinkApp.SWITCH)) # have a consistent order overall ALL.sort(key=lambda t: t.name) diff --git a/scripts/build/builders/telink.py b/scripts/build/builders/telink.py index 7aff204beec33c..880884b7b90ec1 100644 --- a/scripts/build/builders/telink.py +++ b/scripts/build/builders/telink.py @@ -22,16 +22,21 @@ class TelinkApp(Enum): LIGHT = auto() + SWITCH = auto() def ExampleName(self): if self == TelinkApp.LIGHT: return 'lighting-app' + elif self == TelinkApp.SWITCH: + return 'light-switch-app' else: raise Exception('Unknown app type: %r' % self) def AppNamePrefix(self): if self == TelinkApp.LIGHT: return 'chip-telink-lighting-example' + elif self == TelinkApp.SWITCH: + return 'chip-telink-light-switch-example' else: raise Exception('Unknown app type: %r' % self) @@ -51,7 +56,7 @@ class TelinkBuilder(Builder): def __init__(self, root, runner, - app: TelinkApp = TelinkApp.LIGHT, + app: TelinkApp = TelinkApp, board: TelinkBoard = TelinkBoard.TLSR9518ADK80D): super(TelinkBuilder, self).__init__(root, runner) self.app = app diff --git a/scripts/build/testdata/all_targets_except_host.txt b/scripts/build/testdata/all_targets_except_host.txt index a97608af99fef6..53a80eb027465b 100644 --- a/scripts/build/testdata/all_targets_except_host.txt +++ b/scripts/build/testdata/all_targets_except_host.txt @@ -207,6 +207,7 @@ qpg-lock qpg-persistent-storage qpg-shell telink-tlsr9518adk80d-light +telink-tlsr9518adk80d-light-switch tizen-arm-light tizen-arm-light-asan (NOGLOB: Reduce default build variants) tizen-arm-light-no-ble (NOGLOB: Reduce default build variants) diff --git a/scripts/build/testdata/build_all_except_host.txt b/scripts/build/testdata/build_all_except_host.txt index 1a7820ebc89b7f..2b92b78af71233 100644 --- a/scripts/build/testdata/build_all_except_host.txt +++ b/scripts/build/testdata/build_all_except_host.txt @@ -949,6 +949,13 @@ export ZEPHYR_TOOLCHAIN_VARIANT=zephyr source "$ZEPHYR_BASE/zephyr-env.sh"; west build --cmake-only -d {out}/telink-tlsr9518adk80d-light -b tlsr9518adk80d {root}/examples/lighting-app/telink' +# Generating telink-tlsr9518adk80d-light-switch +bash -c 'export ZEPHYR_BASE="$TELINK_ZEPHYR_BASE" +export ZEPHYR_SDK_INSTALL_DIR="$TELINK_ZEPHYR_SDK_DIR" +export ZEPHYR_TOOLCHAIN_VARIANT=zephyr +source "$ZEPHYR_BASE/zephyr-env.sh"; +west build --cmake-only -d {out}/telink-tlsr9518adk80d-light-switch -b tlsr9518adk80d {root}/examples/light-switch-app/telink' + # Generating tizen-arm-light gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lighting-app/linux '--args=target_os="tizen" target_cpu="arm" tizen_sdk_root="TEST_TIZEN_SDK_ROOT" sysroot="TEST_TIZEN_SDK_SYSROOT"' {out}/tizen-arm-light @@ -1918,6 +1925,9 @@ ninja -C {out}/qpg-shell # Building telink-tlsr9518adk80d-light ninja -C {out}/telink-tlsr9518adk80d-light +# Building telink-tlsr9518adk80d-light-switch +ninja -C {out}/telink-tlsr9518adk80d-light-switch + # Building tizen-arm-light ninja -C {out}/tizen-arm-light diff --git a/scripts/build/testdata/glob_star_targets_except_host.txt b/scripts/build/testdata/glob_star_targets_except_host.txt index 8783e163a04bf8..ae7cfde3cb81ee 100644 --- a/scripts/build/testdata/glob_star_targets_except_host.txt +++ b/scripts/build/testdata/glob_star_targets_except_host.txt @@ -88,4 +88,5 @@ qpg-lock qpg-persistent-storage qpg-shell telink-tlsr9518adk80d-light +telink-tlsr9518adk80d-light-switch tizen-arm-light