Skip to content

Commit c4edc2d

Browse files
vikrant8052jhedberg
authored andcommitted
samples: mesh: nrf52: removed redundant global variable
Removed global variable 'default_tt' & code depend on it which is redundant as per latest implementation. Signed-off-by: Vikrant More <[email protected]>
1 parent 13a5add commit c4edc2d

File tree

4 files changed

+22
-30
lines changed

4 files changed

+22
-30
lines changed

samples/boards/nrf/mesh/onoff_level_lighting_vnd_app/src/main.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ static void light_default_status_init(void)
8686
break;
8787
}
8888

89-
default_tt = ctl->tt;
90-
9189
ctl->light->target = ctl->light->current;
9290
ctl->temp->target = ctl->temp->current;
9391
ctl->duv->target = ctl->duv->current;

samples/boards/nrf/mesh/onoff_level_lighting_vnd_app/src/mesh/device_composition.c

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ static void gen_onoff_set_unack(struct bt_mesh_model *model,
166166

167167
switch (buf->len) {
168168
case 0x00: /* No optional fields are available */
169-
tt = default_tt;
169+
tt = ctl->tt;
170170
delay = 0U;
171171
break;
172172
case 0x02: /* Optional fields are available */
@@ -234,7 +234,7 @@ static void gen_onoff_set(struct bt_mesh_model *model,
234234

235235
switch (buf->len) {
236236
case 0x00: /* No optional fields are available */
237-
tt = default_tt;
237+
tt = ctl->tt;
238238
delay = 0U;
239239
break;
240240
case 0x02: /* Optional fields are available */
@@ -364,7 +364,7 @@ static void gen_level_set_unack(struct bt_mesh_model *model,
364364

365365
switch (buf->len) {
366366
case 0x00: /* No optional fields are available */
367-
tt = default_tt;
367+
tt = ctl->tt;
368368
delay = 0U;
369369
break;
370370
case 0x02: /* Optional fields are available */
@@ -429,7 +429,7 @@ static void gen_level_set(struct bt_mesh_model *model,
429429

430430
switch (buf->len) {
431431
case 0x00: /* No optional fields are available */
432-
tt = default_tt;
432+
tt = ctl->tt;
433433
delay = 0U;
434434
break;
435435
case 0x02: /* Optional fields are available */
@@ -504,7 +504,7 @@ static void gen_delta_set_unack(struct bt_mesh_model *model,
504504

505505
switch (buf->len) {
506506
case 0x00: /* No optional fields are available */
507-
tt = default_tt;
507+
tt = ctl->tt;
508508
delay = 0U;
509509
break;
510510
case 0x02: /* Optional fields are available */
@@ -585,7 +585,7 @@ static void gen_delta_set(struct bt_mesh_model *model,
585585

586586
switch (buf->len) {
587587
case 0x00: /* No optional fields are available */
588-
tt = default_tt;
588+
tt = ctl->tt;
589589
delay = 0U;
590590
break;
591591
case 0x02: /* Optional fields are available */
@@ -658,7 +658,7 @@ static void gen_move_set_unack(struct bt_mesh_model *model,
658658

659659
switch (buf->len) {
660660
case 0x00: /* No optional fields are available */
661-
tt = default_tt;
661+
tt = ctl->tt;
662662
delay = 0U;
663663
break;
664664
case 0x02: /* Optional fields are available */
@@ -732,7 +732,7 @@ static void gen_move_set(struct bt_mesh_model *model,
732732

733733
switch (buf->len) {
734734
case 0x00: /* No optional fields are available */
735-
tt = default_tt;
735+
tt = ctl->tt;
736736
delay = 0U;
737737
break;
738738
case 0x02: /* Optional fields are available */
@@ -847,7 +847,6 @@ static void gen_def_trans_time_set_unack(struct bt_mesh_model *model,
847847

848848
if (ctl->tt != tt) {
849849
ctl->tt = tt;
850-
default_tt = tt;
851850

852851
gen_def_trans_time_publish(model);
853852
save_on_flash(GEN_DEF_TRANS_TIME_STATE);
@@ -868,7 +867,6 @@ static void gen_def_trans_time_set(struct bt_mesh_model *model,
868867

869868
if (ctl->tt != tt) {
870869
ctl->tt = tt;
871-
default_tt = tt;
872870

873871
gen_def_trans_time_get(model, ctx, buf);
874872
gen_def_trans_time_publish(model);
@@ -1113,7 +1111,7 @@ static void light_lightness_set_unack(struct bt_mesh_model *model,
11131111

11141112
switch (buf->len) {
11151113
case 0x00: /* No optional fields are available */
1116-
tt = default_tt;
1114+
tt = ctl->tt;
11171115
delay = 0U;
11181116
break;
11191117
case 0x02: /* Optional fields are available */
@@ -1178,7 +1176,7 @@ static void light_lightness_set(struct bt_mesh_model *model,
11781176

11791177
switch (buf->len) {
11801178
case 0x00: /* No optional fields are available */
1181-
tt = default_tt;
1179+
tt = ctl->tt;
11821180
delay = 0U;
11831181
break;
11841182
case 0x02: /* Optional fields are available */
@@ -1295,7 +1293,7 @@ static void light_lightness_linear_set_unack(struct bt_mesh_model *model,
12951293

12961294
switch (buf->len) {
12971295
case 0x00: /* No optional fields are available */
1298-
tt = default_tt;
1296+
tt = ctl->tt;
12991297
delay = 0U;
13001298
break;
13011299
case 0x02: /* Optional fields are available */
@@ -1360,7 +1358,7 @@ static void light_lightness_linear_set(struct bt_mesh_model *model,
13601358

13611359
switch (buf->len) {
13621360
case 0x00: /* No optional fields are available */
1363-
tt = default_tt;
1361+
tt = ctl->tt;
13641362
delay = 0U;
13651363
break;
13661364
case 0x02: /* Optional fields are available */
@@ -1739,7 +1737,7 @@ static void light_ctl_set_unack(struct bt_mesh_model *model,
17391737

17401738
switch (buf->len) {
17411739
case 0x00: /* No optional fields are available */
1742-
tt = default_tt;
1740+
tt = ctl->tt;
17431741
delay = 0U;
17441742
break;
17451743
case 0x02: /* Optional fields are available */
@@ -1817,7 +1815,7 @@ static void light_ctl_set(struct bt_mesh_model *model,
18171815

18181816
switch (buf->len) {
18191817
case 0x00: /* No optional fields are available */
1820-
tt = default_tt;
1818+
tt = ctl->tt;
18211819
delay = 0U;
18221820
break;
18231821
case 0x02: /* Optional fields are available */
@@ -2216,7 +2214,7 @@ static void light_ctl_temp_set_unack(struct bt_mesh_model *model,
22162214

22172215
switch (buf->len) {
22182216
case 0x00: /* No optional fields are available */
2219-
tt = default_tt;
2217+
tt = ctl->tt;
22202218
delay = 0U;
22212219
break;
22222220
case 0x02: /* Optional fields are available */
@@ -2290,7 +2288,7 @@ static void light_ctl_temp_set(struct bt_mesh_model *model,
22902288

22912289
switch (buf->len) {
22922290
case 0x00: /* No optional fields are available */
2293-
tt = default_tt;
2291+
tt = ctl->tt;
22942292
delay = 0U;
22952293
break;
22962294
case 0x02: /* Optional fields are available */
@@ -2409,7 +2407,7 @@ static void gen_level_set_unack_temp(struct bt_mesh_model *model,
24092407

24102408
switch (buf->len) {
24112409
case 0x00: /* No optional fields are available */
2412-
tt = default_tt;
2410+
tt = ctl->tt;
24132411
delay = 0U;
24142412
break;
24152413
case 0x02: /* Optional fields are available */
@@ -2474,7 +2472,7 @@ static void gen_level_set_temp(struct bt_mesh_model *model,
24742472

24752473
switch (buf->len) {
24762474
case 0x00: /* No optional fields are available */
2477-
tt = default_tt;
2475+
tt = ctl->tt;
24782476
delay = 0U;
24792477
break;
24802478
case 0x02: /* Optional fields are available */
@@ -2549,7 +2547,7 @@ static void gen_delta_set_unack_temp(struct bt_mesh_model *model,
25492547

25502548
switch (buf->len) {
25512549
case 0x00: /* No optional fields are available */
2552-
tt = default_tt;
2550+
tt = ctl->tt;
25532551
delay = 0U;
25542552
break;
25552553
case 0x02: /* Optional fields are available */
@@ -2630,7 +2628,7 @@ static void gen_delta_set_temp(struct bt_mesh_model *model,
26302628

26312629
switch (buf->len) {
26322630
case 0x00: /* No optional fields are available */
2633-
tt = default_tt;
2631+
tt = ctl->tt;
26342632
delay = 0U;
26352633
break;
26362634
case 0x02: /* Optional fields are available */
@@ -2703,7 +2701,7 @@ static void gen_move_set_unack_temp(struct bt_mesh_model *model,
27032701

27042702
switch (buf->len) {
27052703
case 0x00: /* No optional fields are available */
2706-
tt = default_tt;
2704+
tt = ctl->tt;
27072705
delay = 0U;
27082706
break;
27092707
case 0x02: /* Optional fields are available */
@@ -2777,7 +2775,7 @@ static void gen_move_set_temp(struct bt_mesh_model *model,
27772775

27782776
switch (buf->len) {
27792777
case 0x00: /* No optional fields are available */
2780-
tt = default_tt;
2778+
tt = ctl->tt;
27812779
delay = 0U;
27822780
break;
27832781
case 0x02: /* Optional fields are available */

samples/boards/nrf/mesh/onoff_level_lighting_vnd_app/src/mesh/transition.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
#include "state_binding.h"
1414
#include "transition.h"
1515

16-
u8_t default_tt;
17-
1816
struct transition transition;
1917

2018
/* Function to calculate Remaining Time (Start) */

samples/boards/nrf/mesh/onoff_level_lighting_vnd_app/src/mesh/transition.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ struct transition {
3232
struct k_timer timer;
3333
};
3434

35-
extern u8_t default_tt;
36-
3735
extern struct transition transition;
3836

3937
extern struct k_timer dummy_timer;

0 commit comments

Comments
 (0)