Skip to content

Commit 79a4a7c

Browse files
committed
Merge branch 'icd_support_for_cc13x4' of github.com:abiradarti/connectedhomeip into icd_support_for_cc13x4
2 parents fee3cc0 + 4082fd7 commit 79a4a7c

File tree

17 files changed

+241
-234
lines changed

17 files changed

+241
-234
lines changed

examples/all-clusters-app/cc13x4_26x4/BUILD.gn

+5-2
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,11 @@ ti_simplelink_executable("all-clusters-app") {
119119
defines = [ "CC13XX_26XX_FACTORY_DATA" ]
120120
}
121121

122-
if(chip_enable_icd_server){
123-
defines += ["CHIP_DEVICE_CONFIG_ENABLE_SED", "TI_ICD_ENABLE_SERVER"]
122+
if (chip_enable_icd_server) {
123+
defines += [
124+
"CHIP_DEVICE_CONFIG_ENABLE_SED",
125+
"TI_ICD_ENABLE_SERVER",
126+
]
124127
}
125128

126129
include_dirs = [

examples/all-clusters-app/cc13x4_26x4/main/AppTask.cpp

+31-33
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,6 @@ void AppTask::PostEvent(const AppEvent * aEvent)
290290
}
291291
}
292292

293-
294-
295293
void AppTask::DispatchEvent(AppEvent * aEvent)
296294
{
297295
switch (aEvent->Type)
@@ -390,40 +388,40 @@ void AppTask::ButtonRightEventHandler(Button_Handle handle, Button_EventMask eve
390388

391389
void AppTask::uiInit(void)
392390
{
393-
#ifdef LED_ENABLE
391+
#ifdef LED_ENABLE
394392

395-
LED_Params ledParams;
393+
LED_Params ledParams;
396394

397-
// Initialize LEDs
398-
PLAT_LOG("Initialize LEDs");
399-
LED_init();
395+
// Initialize LEDs
396+
PLAT_LOG("Initialize LEDs");
397+
LED_init();
400398

401-
LED_Params_init(&ledParams); // default PWM LED
402-
sAppRedHandle = LED_open(CONFIG_LED_RED, &ledParams);
403-
LED_setOff(sAppRedHandle);
399+
LED_Params_init(&ledParams); // default PWM LED
400+
sAppRedHandle = LED_open(CONFIG_LED_RED, &ledParams);
401+
LED_setOff(sAppRedHandle);
404402

405-
LED_Params_init(&ledParams); // default PWM LED
406-
sAppGreenHandle = LED_open(CONFIG_LED_GREEN, &ledParams);
407-
LED_setOff(sAppGreenHandle);
408-
#endif //LED ENABLE
403+
LED_Params_init(&ledParams); // default PWM LED
404+
sAppGreenHandle = LED_open(CONFIG_LED_GREEN, &ledParams);
405+
LED_setOff(sAppGreenHandle);
406+
#endif // LED ENABLE
409407

410408
#ifdef BUTTON_ENABLE
411-
Button_Params buttonParams;
412-
413-
// Initialize buttons
414-
PLAT_LOG("Initialize buttons");
415-
Button_init();
416-
417-
Button_Params_init(&buttonParams);
418-
buttonParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED;
419-
buttonParams.longPressDuration = 1000U; // ms
420-
sAppLeftHandle = Button_open(CONFIG_BTN_LEFT, &buttonParams);
421-
Button_setCallback(sAppLeftHandle, ButtonLeftEventHandler);
422-
423-
Button_Params_init(&buttonParams);
424-
buttonParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED;
425-
buttonParams.longPressDuration = 1000U; // ms
426-
sAppRightHandle = Button_open(CONFIG_BTN_RIGHT, &buttonParams);
427-
Button_setCallback(sAppRightHandle, ButtonRightEventHandler);
428-
#endif //BUTTON ENABLE
429-
}
409+
Button_Params buttonParams;
410+
411+
// Initialize buttons
412+
PLAT_LOG("Initialize buttons");
413+
Button_init();
414+
415+
Button_Params_init(&buttonParams);
416+
buttonParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED;
417+
buttonParams.longPressDuration = 1000U; // ms
418+
sAppLeftHandle = Button_open(CONFIG_BTN_LEFT, &buttonParams);
419+
Button_setCallback(sAppLeftHandle, ButtonLeftEventHandler);
420+
421+
Button_Params_init(&buttonParams);
422+
buttonParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED;
423+
buttonParams.longPressDuration = 1000U; // ms
424+
sAppRightHandle = Button_open(CONFIG_BTN_RIGHT, &buttonParams);
425+
Button_setCallback(sAppRightHandle, ButtonRightEventHandler);
426+
#endif // BUTTON ENABLE
427+
}

examples/lighting-app/cc13x4_26x4/BUILD.gn

+6-4
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ ti_sysconfig("sysconfig") {
6868
cflags = [
6969
"-Wno-comment",
7070
"@" + rebase_path("${target_gen_dir}/sysconfig/ti_utils_build_compiler.opt",
71-
root_build_dir),
71+
root_build_dir),
7272
]
7373
}
7474

@@ -101,9 +101,11 @@ ti_simplelink_executable("lighting_app") {
101101
defines = [ "CC13XX_26XX_FACTORY_DATA" ]
102102
}
103103

104-
if(chip_enable_icd_server){
105-
defines += ["CHIP_DEVICE_CONFIG_ENABLE_SED",
106-
"TI_ICD_ENABLE_SERVER"]
104+
if (chip_enable_icd_server) {
105+
defines += [
106+
"CHIP_DEVICE_CONFIG_ENABLE_SED",
107+
"TI_ICD_ENABLE_SERVER",
108+
]
107109
}
108110

109111
include_dirs = [

examples/lighting-app/cc13x4_26x4/src/AppTask.cpp

+39-41
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ void uiTurnedOn(void);
9595
void uiTurnOff(void);
9696
void uiTurnedOff(void);
9797

98-
9998
#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
10099
static DefaultOTARequestor sRequestorCore;
101100
static DefaultOTARequestorStorage sRequestorStorage;
@@ -148,7 +147,7 @@ void identify_TakeAction(void)
148147
#ifdef LED_ENABLE
149148
LED_setOn(sAppGreenHandle, LED_BRIGHTNESS_MAX);
150149
LED_startBlinking(sAppGreenHandle, 1000, LED_BLINK_FOREVER);
151-
#endif //LED_ENABLE
150+
#endif // LED_ENABLE
152151
}
153152

154153
// Identify stop action
@@ -157,7 +156,7 @@ void identify_StopAction(void)
157156
#ifdef LED_ENABLE
158157
LED_stopBlinking(sAppGreenHandle);
159158
LED_setOff(sAppGreenHandle);
160-
#endif //LED_ENABLE
159+
#endif // LED_ENABLE
161160
}
162161

163162
int AppTask::Init()
@@ -189,8 +188,8 @@ int AppTask::Init()
189188
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SleepyEndDevice);
190189
#else
191190
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice);
192-
#endif //CHIP_DEVICE_CONFIG_ENABLE_SED
193-
#endif //CHIP_DEVICE_CONFIG_THREAD_FTD
191+
#endif // CHIP_DEVICE_CONFIG_ENABLE_SED
192+
#endif // CHIP_DEVICE_CONFIG_THREAD_FTD
194193
if (ret != CHIP_NO_ERROR)
195194
{
196195
PLAT_LOG("ConnectivityMgr().SetThreadDeviceType() failed");
@@ -483,7 +482,7 @@ void uiTurnOn(void)
483482
#ifdef LED_ENABLE
484483
LED_setOn(sAppRedHandle, LED_BRIGHTNESS_MAX);
485484
LED_startBlinking(sAppRedHandle, 110 /* ms */, LED_BLINK_FOREVER);
486-
#endif //LED_ENABLE
485+
#endif // LED_ENABLE
487486
}
488487

489488
// Action completed callback
@@ -493,7 +492,7 @@ void uiTurnedOn(void)
493492
#ifdef LED_ENABLE
494493
LED_stopBlinking(sAppRedHandle);
495494
LED_setOn(sAppRedHandle, LED_BRIGHTNESS_MAX);
496-
#endif //LED_ENABLE
495+
#endif // LED_ENABLE
497496
}
498497

499498
// Action initiated callback
@@ -503,7 +502,7 @@ void uiTurnOff(void)
503502
#ifdef LED_ENABLE
504503
LED_setOn(sAppRedHandle, LED_BRIGHTNESS_MAX);
505504
LED_startBlinking(sAppRedHandle, 110 /* ms */, LED_BLINK_FOREVER);
506-
#endif //LED_ENABLE
505+
#endif // LED_ENABLE
507506
}
508507

509508
// Action completed callback
@@ -513,10 +512,9 @@ void uiTurnedOff(void)
513512
#ifdef LED_ENABLE
514513
LED_stopBlinking(sAppRedHandle);
515514
LED_setOff(sAppRedHandle);
516-
#endif //LED_ENABLE
515+
#endif // LED_ENABLE
517516
}
518517

519-
520518
#ifdef BUTTON_ENABLE
521519
void AppTask::ButtonLeftEventHandler(Button_Handle handle, Button_EventMask events)
522520
{
@@ -557,44 +555,44 @@ void AppTask::ButtonRightEventHandler(Button_Handle handle, Button_EventMask eve
557555
/* Failed to post the message */
558556
}
559557
}
560-
#endif //BUTTON_ENABLE
558+
#endif // BUTTON_ENABLE
561559

562560
void AppTask::uiInit(void)
563561
{
564-
#ifdef LED_ENABLE
562+
#ifdef LED_ENABLE
565563

566-
LED_Params ledParams;
564+
LED_Params ledParams;
567565

568-
// Initialize LEDs
569-
PLAT_LOG("Initialize LEDs");
570-
LED_init();
566+
// Initialize LEDs
567+
PLAT_LOG("Initialize LEDs");
568+
LED_init();
571569

572-
LED_Params_init(&ledParams); // default PWM LED
573-
sAppRedHandle = LED_open(CONFIG_LED_RED, &ledParams);
574-
LED_setOff(sAppRedHandle);
570+
LED_Params_init(&ledParams); // default PWM LED
571+
sAppRedHandle = LED_open(CONFIG_LED_RED, &ledParams);
572+
LED_setOff(sAppRedHandle);
575573

576-
LED_Params_init(&ledParams); // default PWM LED
577-
sAppGreenHandle = LED_open(CONFIG_LED_GREEN, &ledParams);
578-
LED_setOff(sAppGreenHandle);
579-
#endif //LED ENABLE
574+
LED_Params_init(&ledParams); // default PWM LED
575+
sAppGreenHandle = LED_open(CONFIG_LED_GREEN, &ledParams);
576+
LED_setOff(sAppGreenHandle);
577+
#endif // LED ENABLE
580578

581579
#ifdef BUTTON_ENABLE
582-
Button_Params buttonParams;
583-
584-
// Initialize buttons
585-
PLAT_LOG("Initialize buttons");
586-
Button_init();
587-
588-
Button_Params_init(&buttonParams);
589-
buttonParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED;
590-
buttonParams.longPressDuration = 1000U; // ms
591-
sAppLeftHandle = Button_open(CONFIG_BTN_LEFT, &buttonParams);
592-
Button_setCallback(sAppLeftHandle, ButtonLeftEventHandler);
593-
594-
Button_Params_init(&buttonParams);
595-
buttonParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED;
596-
buttonParams.longPressDuration = 1000U; // ms
597-
sAppRightHandle = Button_open(CONFIG_BTN_RIGHT, &buttonParams);
598-
Button_setCallback(sAppRightHandle, ButtonRightEventHandler);
599-
#endif //BUTTON ENABLE
580+
Button_Params buttonParams;
581+
582+
// Initialize buttons
583+
PLAT_LOG("Initialize buttons");
584+
Button_init();
585+
586+
Button_Params_init(&buttonParams);
587+
buttonParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED;
588+
buttonParams.longPressDuration = 1000U; // ms
589+
sAppLeftHandle = Button_open(CONFIG_BTN_LEFT, &buttonParams);
590+
Button_setCallback(sAppLeftHandle, ButtonLeftEventHandler);
591+
592+
Button_Params_init(&buttonParams);
593+
buttonParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED;
594+
buttonParams.longPressDuration = 1000U; // ms
595+
sAppRightHandle = Button_open(CONFIG_BTN_RIGHT, &buttonParams);
596+
Button_setCallback(sAppRightHandle, ButtonRightEventHandler);
597+
#endif // BUTTON ENABLE
600598
}

examples/lock-app/cc13x4_26x4/BUILD.gn

+5-2
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,11 @@ ti_simplelink_executable("lock_app") {
105105
defines = [ "CC13XX_26XX_FACTORY_DATA" ]
106106
}
107107

108-
if(chip_enable_icd_server){
109-
defines += ["CHIP_DEVICE_CONFIG_ENABLE_SED", "TI_ICD_ENABLE_SERVER"]
108+
if (chip_enable_icd_server) {
109+
defines += [
110+
"CHIP_DEVICE_CONFIG_ENABLE_SED",
111+
"TI_ICD_ENABLE_SERVER",
112+
]
110113
}
111114
include_dirs = [
112115
"${project_dir}",

examples/lock-app/cc13x4_26x4/src/AppTask.cpp

+34-34
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ void identify_TakeAction(void)
139139
#ifdef LED_ENABLE
140140
LED_setOn(sAppGreenHandle, LED_BRIGHTNESS_MAX);
141141
LED_startBlinking(sAppGreenHandle, 1000, LED_BLINK_FOREVER);
142-
#endif //LED_ENABLE
142+
#endif // LED_ENABLE
143143
}
144144

145145
// Identify stop action
@@ -148,7 +148,7 @@ void identify_StopAction(void)
148148
#ifdef LED_ENABLE
149149
LED_stopBlinking(sAppGreenHandle);
150150
LED_setOff(sAppGreenHandle);
151-
#endif //LED_ENABLE
151+
#endif // LED_ENABLE
152152
}
153153

154154
int AppTask::Init()
@@ -179,8 +179,8 @@ int AppTask::Init()
179179
#if CHIP_DEVICE_CONFIG_ENABLE_SED
180180
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SleepyEndDevice);
181181
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice);
182-
#endif //CHIP_DEVICE_CONFIG_ENABLE_SED
183-
#endif //CHIP_DEVICE_CONFIG_THREAD_FTD
182+
#endif // CHIP_DEVICE_CONFIG_ENABLE_SED
183+
#endif // CHIP_DEVICE_CONFIG_THREAD_FTD
184184

185185
if (ret != CHIP_NO_ERROR)
186186
{
@@ -577,44 +577,44 @@ void AppTask::ButtonRightEventHandler(Button_Handle handle, Button_EventMask eve
577577
/* Failed to post the message */
578578
}
579579
}
580-
#endif //BUTTON_ENABLE
580+
#endif // BUTTON_ENABLE
581581

582582
void AppTask::uiInit(void)
583583
{
584584
#ifdef LED_ENABLE
585585

586-
LED_Params ledParams;
586+
LED_Params ledParams;
587587

588-
// Initialize LEDs
589-
PLAT_LOG("Initialize LEDs");
590-
LED_init();
588+
// Initialize LEDs
589+
PLAT_LOG("Initialize LEDs");
590+
LED_init();
591591

592-
LED_Params_init(&ledParams); // default PWM LED
593-
sAppRedHandle = LED_open(CONFIG_LED_RED, &ledParams);
594-
LED_setOff(sAppRedHandle);
592+
LED_Params_init(&ledParams); // default PWM LED
593+
sAppRedHandle = LED_open(CONFIG_LED_RED, &ledParams);
594+
LED_setOff(sAppRedHandle);
595595

596-
LED_Params_init(&ledParams); // default PWM LED
597-
sAppGreenHandle = LED_open(CONFIG_LED_GREEN, &ledParams);
598-
LED_setOff(sAppGreenHandle);
599-
#endif //LED ENABLE
596+
LED_Params_init(&ledParams); // default PWM LED
597+
sAppGreenHandle = LED_open(CONFIG_LED_GREEN, &ledParams);
598+
LED_setOff(sAppGreenHandle);
599+
#endif // LED ENABLE
600600

601601
#ifdef BUTTON_ENABLE
602-
Button_Params buttonParams;
603-
604-
// Initialize buttons
605-
PLAT_LOG("Initialize buttons");
606-
Button_init();
607-
608-
Button_Params_init(&buttonParams);
609-
buttonParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED;
610-
buttonParams.longPressDuration = 1000U; // ms
611-
sAppLeftHandle = Button_open(CONFIG_BTN_LEFT, &buttonParams);
612-
Button_setCallback(sAppLeftHandle, ButtonLeftEventHandler);
613-
614-
Button_Params_init(&buttonParams);
615-
buttonParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED;
616-
buttonParams.longPressDuration = 1000U; // ms
617-
sAppRightHandle = Button_open(CONFIG_BTN_RIGHT, &buttonParams);
618-
Button_setCallback(sAppRightHandle, ButtonRightEventHandler);
619-
#endif //BUTTON ENABLE
602+
Button_Params buttonParams;
603+
604+
// Initialize buttons
605+
PLAT_LOG("Initialize buttons");
606+
Button_init();
607+
608+
Button_Params_init(&buttonParams);
609+
buttonParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED;
610+
buttonParams.longPressDuration = 1000U; // ms
611+
sAppLeftHandle = Button_open(CONFIG_BTN_LEFT, &buttonParams);
612+
Button_setCallback(sAppLeftHandle, ButtonLeftEventHandler);
613+
614+
Button_Params_init(&buttonParams);
615+
buttonParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED;
616+
buttonParams.longPressDuration = 1000U; // ms
617+
sAppRightHandle = Button_open(CONFIG_BTN_RIGHT, &buttonParams);
618+
Button_setCallback(sAppRightHandle, ButtonRightEventHandler);
619+
#endif // BUTTON ENABLE
620620
}

0 commit comments

Comments
 (0)