Skip to content

Commit

Permalink
Bluetooth: Mesh: Moved case statment as code was the same
Browse files Browse the repository at this point in the history
The code for the two case statements was the same, so merged
the case statement to use the same code.

Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
  • Loading branch information
Balaklaka committed Aug 10, 2023
1 parent 8d3c7d8 commit 850c7a7
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions subsys/bluetooth/mesh/light_ctrl_srv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1622,6 +1622,7 @@ static int light_ctrl_srv_start(struct bt_mesh_model *model)

switch (srv->lightness->ponoff.on_power_up) {
case BT_MESH_ON_POWER_UP_OFF:
case BT_MESH_ON_POWER_UP_ON:
if (atomic_test_bit(&srv->flags,
FLAG_CTRL_SRV_MANUALLY_ENABLED)) {
ctrl_enable(srv);
Expand All @@ -1639,17 +1640,6 @@ static int light_ctrl_srv_start(struct bt_mesh_model *model)
*/
store(srv, FLAG_STORE_STATE);
break;
case BT_MESH_ON_POWER_UP_ON:
if (atomic_test_bit(&srv->flags,
FLAG_CTRL_SRV_MANUALLY_ENABLED)) {
ctrl_enable(srv);
} else {
lightness_on_power_up(srv->lightness);
ctrl_disable(srv);
schedule_resume_timer(srv);
}
store(srv, FLAG_STORE_STATE);
break;
case BT_MESH_ON_POWER_UP_RESTORE:
if (is_enabled(srv)) {
reg_start(srv);
Expand Down

0 comments on commit 850c7a7

Please sign in to comment.