Skip to content

Commit 7453cf8

Browse files
committed
src/light: rename config option
This was sharing the config option with the driver counterpart. Each module should have its own config option.
1 parent 58101c3 commit 7453cf8

File tree

9 files changed

+16
-12
lines changed

9 files changed

+16
-12
lines changed

bricks/cityhub/pbioconfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#define PBIO_CONFIG_IOPORT_LPF2 (1)
55

66
#define PBIO_CONFIG_DCMOTOR (1)
7-
7+
#define PBIO_CONFIG_LIGHT (1)
88
#define PBIO_CONFIG_TACHO (1)
99

1010
#define PBIO_CONFIG_UARTDEV (1)

bricks/cplushub/pbioconfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#define PBIO_CONFIG_IOPORT_LPF2 (1)
55

66
#define PBIO_CONFIG_DCMOTOR (1)
7-
7+
#define PBIO_CONFIG_LIGHT (1)
88
#define PBIO_CONFIG_TACHO (1)
99

1010
#define PBIO_CONFIG_UARTDEV (1)

bricks/debug/pbioconfig.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// SPDX-License-Identifier: MIT
22
// Copyright (c) 2019-2020 The Pybricks Authors
33

4+
#define PBIO_CONFIG_LIGHT (1)
5+
46
#define PBIO_CONFIG_UARTDEV (1)
57
#define PBIO_CONFIG_UARTDEV_NUM_DEV (1)
68

bricks/ev3dev/pbioconfig.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
// Copyright (c) 2019-2020 The Pybricks Authors
33

44
#define PBIO_CONFIG_EV3_INPUT_DEVICE (1)
5-
65
#define PBIO_CONFIG_DCMOTOR (1)
7-
6+
#define PBIO_CONFIG_LIGHT (1)
87
#define PBIO_CONFIG_SERIAL (1)
9-
108
#define PBIO_CONFIG_TACHO (1)

bricks/movehub/pbioconfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#define PBIO_CONFIG_IOPORT_LPF2 (1)
55

66
#define PBIO_CONFIG_DCMOTOR (1)
7-
7+
#define PBIO_CONFIG_LIGHT (1)
88
#define PBIO_CONFIG_TACHO (1)
99

1010
#define PBIO_CONFIG_UARTDEV (1)

bricks/primehub/pbioconfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#define PBIO_CONFIG_IOPORT_LPF2 (1)
55

66
#define PBIO_CONFIG_DCMOTOR (1)
7-
7+
#define PBIO_CONFIG_LIGHT (1)
88
#define PBIO_CONFIG_TACHO (1)
99

1010
#define PBIO_CONFIG_UARTDEV (1)

lib/pbio/doc/doxygen.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2100,6 +2100,7 @@ INCLUDE_FILE_PATTERNS =
21002100
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
21012101

21022102
PREDEFINED = \
2103+
PBIO_CONFIG_LIGHT=1 \
21032104
PBIO_CONFIG_ENABLE_DEINIT \
21042105
PBIO_CONFIG_ENABLE_SYS \
21052106
PBDRV_CONFIG_PWM=1

lib/pbio/include/pbio/light.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <stdbool.h>
1313

1414
#include <pbio/color.h>
15+
#include <pbio/config.h>
1516
#include <pbio/error.h>
1617
#include <pbio/port.h>
1718

@@ -24,7 +25,7 @@ typedef enum {
2425
PBIO_LIGHT_PATTERN_BREATHE, /**< The light breathes */
2526
} pbio_light_pattern_t;
2627

27-
#if PBDRV_CONFIG_LIGHT
28+
#if PBIO_CONFIG_LIGHT
2829

2930
/**
3031
* Turns the light on. Some lights may not be capable of display all colors or
@@ -74,7 +75,7 @@ static inline void _pbio_light_set_user_mode(bool user_mode) {
7475
static inline pbio_error_t _pbio_light_on(pbio_port_t port, pbio_color_t color, pbio_light_pattern_t pattern) {
7576
return PBIO_SUCCESS;
7677
}
77-
#endif // PBDRV_CONFIG_LIGHT
78+
#endif // PBIO_CONFIG_LIGHT
7879

7980
/** @cond */
8081
// using macros for reduced code size

lib/pbio/src/light.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// SPDX-License-Identifier: MIT
22
// Copyright (c) 2018-2020 The Pybricks Authors
33

4+
#include <pbio/config.h>
5+
6+
#if PBIO_CONFIG_LIGHT
7+
48
#include <stdbool.h>
59

610
#include <pbio/color.h>
@@ -10,8 +14,6 @@
1014

1115
#include <pbdrv/light.h>
1216

13-
#if PBDRV_CONFIG_LIGHT
14-
1517
typedef struct {
1618
pbio_light_pattern_t pattern;
1719
pbdrv_light_raw_rgb_t raw;
@@ -104,4 +106,4 @@ void _pbio_light_set_user_mode(bool user_mode) {
104106
user_mode_active = user_mode;
105107
}
106108

107-
#endif // PBDRV_CONFIG_LIGHT
109+
#endif // PBIO_CONFIG_LIGHT

0 commit comments

Comments
 (0)