File tree 6 files changed +34
-6
lines changed
6 files changed +34
-6
lines changed Original file line number Diff line number Diff line change 4
4
* resulting in a compile error.
5
5
*/
6
6
7
- int myFunc(int const a, int const b);
7
+ /* To fix this in the "class-wrapping" method, don't write
8
+ * forward declarations.
9
+ */
10
+
11
+ //int myFunc(int const a, int const b);
8
12
9
13
void setup()
10
14
{
Original file line number Diff line number Diff line change 5
5
* 'void myEventHandler(void)'
6
6
*/
7
7
8
- void myEventHandler()
8
+ /* To fix this in the "class-wrapping" method, add `static`
9
+ * in front of the callback declaration.
10
+ */
11
+
12
+ static void myEventHandler()
9
13
{
10
14
/* Do something. */
11
15
}
Original file line number Diff line number Diff line change 2
2
* a static member variable is forbidden.
3
3
*/
4
4
5
- static int my_global_variable = 0;
5
+ /* To fix this in the "class-wrapping" method, remove `static`
6
+ * or remove the initialization.
7
+ */
8
+
9
+ /*static*/ int my_global_variable = 0;
10
+
11
+ #if ANOTHER_WAY
12
+ static int my_global_variable;
13
+ #endif
6
14
7
15
void setup()
8
16
{
9
-
17
+ #if ANOTHER_WAY
18
+ // my_global_variable = 0;
19
+ #endif
10
20
}
11
21
12
22
void loop()
Original file line number Diff line number Diff line change 1
1
/* Breaks for all kind of stuff ...
2
2
*/
3
3
4
+ /* To fix this in the "class-wrapping" method, remove `static`
5
+ * and change objects declarations
6
+ * from `Classname obj(args...)`
7
+ * to `Classname obj = Classname{args..}`
8
+ */
9
+
4
10
/**************************************************************************************
5
11
* CONSTANTS
6
12
**************************************************************************************/
@@ -12,7 +18,8 @@ static byte constexpr LSM6DSOX_WHO_AM_I_REG = 0x0F;
12
18
* GLOBAL VARIABLES
13
19
**************************************************************************************/
14
20
15
- BusDevice lsm6dsox(Wire, LSM6DSOX_ADDRESS);
21
+ // BusDevice lsm6dsox(Wire, LSM6DSOX_ADDRESS);
22
+ BusDevice lsm6dsox = BusDevice{Wire, LSM6DSOX_ADDRESS};
16
23
17
24
/**************************************************************************************
18
25
* FUNCTIONS
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ void loop()
13
13
14
14
}
15
15
16
- void myEventHandler()
16
+ static void myEventHandler()
17
17
{
18
18
/* Do something. */
19
19
}
Original file line number Diff line number Diff line change
1
+ /* Break here is intentional
2
+ */
3
+
1
4
void setup()
2
5
{
3
6
You can’t perform that action at this time.
0 commit comments