Skip to content

Commit

Permalink
[Telink]: Added Telink light-switch-app target
Browse files Browse the repository at this point in the history
  • Loading branch information
s07641069 committed May 11, 2022
1 parent b1df7ac commit 2c658a4
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/examples-telink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
1 change: 1 addition & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@
"nrf-nrf5340-shell",
"qpg-qpg6100-lock",
"telink-tlsr9518adk80d-light",
"telink-tlsr9518adk80d-light-switch",
"tizen-arm-light"
]
}
Expand Down
4 changes: 2 additions & 2 deletions examples/light-switch-app/telink/src/ZclCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
2 changes: 2 additions & 0 deletions scripts/build/build/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
7 changes: 6 additions & 1 deletion scripts/build/builders/telink.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions scripts/build/testdata/all_targets_except_host.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 10 additions & 0 deletions scripts/build/testdata/build_all_except_host.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions scripts/build/testdata/glob_star_targets_except_host.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,5 @@ qpg-lock
qpg-persistent-storage
qpg-shell
telink-tlsr9518adk80d-light
telink-tlsr9518adk80d-light-switch
tizen-arm-light

0 comments on commit 2c658a4

Please sign in to comment.