Skip to content

Commit

Permalink
[ASR] Delete duplicate implementations and docs (#27625)
Browse files Browse the repository at this point in the history
* Delete duplicate led and button implementations, all move to examples/platform/asr

* remove support chips,that's already described in asr guide

---------

Co-authored-by: weicheng <[email protected]>
  • Loading branch information
tx2rx and asriot authored Jul 6, 2023
1 parent dfe62c1 commit 9d617b5
Show file tree
Hide file tree
Showing 57 changed files with 220 additions and 1,041 deletions.
2 changes: 1 addition & 1 deletion examples/all-clusters-app/asr/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ asr_executable("clusters_app") {
sources = [
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp",
"${examples_plat_dir}/ButtonHandler.cpp",
"${examples_plat_dir}/CHIPDeviceManager.cpp",
"${examples_plat_dir}/LEDWidget.cpp",
"${examples_plat_dir}/init_Matter.cpp",
"${examples_plat_dir}/init_asrPlatform.cpp",
"${examples_plat_dir}/shell/matter_shell.cpp",
"src/AppTask.cpp",
"src/ButtonHandler.cpp",
"src/DeviceCallbacks.cpp",
"src/main.cpp",
]
Expand Down
8 changes: 0 additions & 8 deletions examples/all-clusters-app/asr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,12 @@ control on ASR platform.
---

- [Matter ASR All Clusters Example](#matter-asr-all-clusters-example)
- [Supported Chips](#supported-chips)
- [Building and Commissioning](#building-and-commissioning)
- [Cluster Control](#cluster-control)
- [Light switch press button and light status LED](#light-switch-press-button-and-light-status-led)

---

## Supported Chips

The Matter demo application is supported on:

- ASR582X
- ASR595X

## Building and Commissioning

Please refer
Expand Down
12 changes: 0 additions & 12 deletions examples/all-clusters-app/asr/include/AppConfig.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,6 @@

#define MATTER_DEVICE_NAME "ASR-Clusters"

#define GPIO_TASK_NAME "gpio"
#define GPIO_TASK_STACK_SIZE 1024

#define APP_BUTTON_PRESSED 0
#define APP_BUTTON_RELEASED 1

#define SWITCH1_BUTTON GPIO12_INDEX
#define SWITCH2_BUTTON GPIO13_INDEX

#define LIGHT1_LED PWM_OUTPUT_CH4
#define LIGHT2_LED PWM_OUTPUT_CH6

// Time it takes in ms for the simulated actuator to move from one
// state to another.
#define ACTUATOR_MOVEMENT_PERIOS_MS 2000
Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-app/asr/include/AppTask.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class AppTask
CHIP_ERROR StartAppTask();
static void AppTaskMain(void * pvParameter);
static void AppEventHandler(AppEvent * aEvent);
void PostButtonEvent(uint8_t btnIdx, uint8_t btnAction);
void ButtonEventHandler(uint8_t btnIdx, uint8_t btnAction);
void PostEvent(const AppEvent * event);
/**
* Use internally for registration of the ChipDeviceEvents
Expand Down
53 changes: 0 additions & 53 deletions examples/all-clusters-app/asr/include/ButtonHandler.h

This file was deleted.

15 changes: 8 additions & 7 deletions examples/all-clusters-app/asr/src/AppTask.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ using namespace ::chip::DeviceManager;
using namespace ::chip::DeviceLayer;
using namespace ::chip::System;

LEDWidget sStatusLED;
LEDWidget sLightLED;

namespace {
Expand Down Expand Up @@ -119,7 +118,11 @@ CHIP_ERROR AppTask::Init()
ConfigurationMgr().LogDeviceConfig();

// Print setup info
#if CONFIG_NETWORK_LAYER_BLE
PrintOnboardingCodes(chip::RendezvousInformationFlag(chip::RendezvousInformationFlag::kBLE));
#else
PrintOnboardingCodes(chip::RendezvousInformationFlag(chip::RendezvousInformationFlag::kOnNetwork));
#endif /* CONFIG_NETWORK_LAYER_BLE */

return CHIP_NO_ERROR;
}
Expand All @@ -131,8 +134,7 @@ void AppTask::AppTaskMain(void * pvParameter)

ButtonHandler::Init();

sLightLED.Init(LIGHT1_LED); // embedded board light
sStatusLED.Init(LIGHT2_LED);
sLightLED.Init(LIGHT_LED);

lega_rtos_start_timer(&sAppTimer);

Expand Down Expand Up @@ -186,7 +188,6 @@ void AppTask::AppEventHandler(AppEvent * aEvent)
if (lightState)
{
sLightLED.Set(1);
sLightLED.SetBrightness(100);
}
else
{
Expand All @@ -213,9 +214,9 @@ void AppTask::AppTimerCallback(void * params)
sAppTask.PostEvent(&timer_event);
}

void AppTask::PostButtonEvent(uint8_t btnIdx, uint8_t btnAction)
void AppTask::ButtonEventHandler(uint8_t btnIdx, uint8_t btnAction)
{
ASR_LOG("%s %s\n", btnIdx == SWITCH1_BUTTON ? "btn1" : "btn2", btnAction == APP_BUTTON_PRESSED ? "Pressed" : "Released");
ASR_LOG("%s %s\n", btnIdx == SWITCH1_BUTTON ? "btn1" : "btn2", btnAction == BUTTON_PRESSED ? "Pressed" : "Released");

if (btnIdx != SWITCH1_BUTTON && btnIdx != SWITCH2_BUTTON)
{
Expand All @@ -227,7 +228,7 @@ void AppTask::PostButtonEvent(uint8_t btnIdx, uint8_t btnAction)
button_event.ButtonEvent.ButtonIdx = btnIdx;
button_event.ButtonEvent.Action = btnAction;

if (btnAction == APP_BUTTON_RELEASED)
if (btnAction == BUTTON_RELEASED)
{
button_event.Handler = AppEventHandler;
sAppTask.PostEvent(&button_event);
Expand Down
117 changes: 0 additions & 117 deletions examples/all-clusters-app/asr/src/ButtonHandler.cpp

This file was deleted.

2 changes: 0 additions & 2 deletions examples/all-clusters-app/asr/src/DeviceCallbacks.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ using namespace ::chip::DeviceManager;
using namespace ::chip::Logging;

extern LEDWidget sLightLED;
extern LEDWidget sStatusLED;

uint32_t identifyTimerCount;
constexpr uint32_t kIdentifyTimerDelayMS = 250;
Expand Down Expand Up @@ -191,7 +190,6 @@ void DeviceCallbacks::OnLevelPostAttributeChangeCallback(EndpointId endpointId,
{
uint8_t tmp = *value;
ChipLogProgress(Zcl, "New level: %u ", tmp);
sLightLED.SetBrightness(tmp);
}
else
{
Expand Down
19 changes: 0 additions & 19 deletions examples/all-clusters-minimal-app/asr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,11 @@ control on ASR platform.
---

- [Matter ASR All Clusters Example](#matter-asr-all-clusters-example)
- [Supported Chips](#supported-chips)
- [Building and Commissioning](#building-and-commissioning)
- [Cluster Control](#cluster-control)
- [Light switch press button and light status LED](#light-switch-press-button-and-light-status-led)

---

## Supported Chips

The Matter demo application is supported on:

- ASR582X
- ASR595X

## Building and Commissioning

Please refer
Expand All @@ -42,13 +33,3 @@ For example,control the OnOff Cluster attribute:
./chip-tool onoff off <NODE ID> 1
./chip-tool onoff toggle <NODE ID> 1
```

## Light switch press button and light status LED

This demo uses button to test changing the light states and LED to show the
state of these changes.

| Name | Pin |
| :----: | :---: |
| LED | PAD6 |
| BUTTON | PAD12 |
6 changes: 0 additions & 6 deletions examples/all-clusters-minimal-app/asr/include/AppConfig.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@

#define MATTER_DEVICE_NAME "ASR-Clusters-m"

#define APP_LIGHT_BUTTON_IDX 0
#define APP_BUTTON_DEBOUNCE_PERIOD_MS 50

#define APP_BUTTON_PRESSED 0
#define APP_BUTTON_RELEASED 1

// Time it takes in ms for the simulated actuator to move from one
// state to another.
#define ACTUATOR_MOVEMENT_PERIOS_MS 2000
Expand Down
Loading

0 comments on commit 9d617b5

Please sign in to comment.