Skip to content

Commit 5119799

Browse files
committed
Fixed compilation when BTNPIN, IRPIN or RLYPIN not defined (fixes wled#1350 )
1 parent b697df3 commit 5119799

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

wled00/cfg.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,7 @@ void serializeConfig() {
419419

420420
JsonArray hw_btn_ins = hw_btn.createNestedArray("ins");
421421

422+
#if defined(BTNPIN) && BTNPIN > -1
422423
JsonObject hw_btn_ins_0 = hw_btn_ins.createNestedObject();
423424
hw_btn_ins_0[F("type")] = (buttonEnabled) ? BTN_TYPE_PUSH : BTN_TYPE_NONE;
424425

@@ -429,16 +430,21 @@ void serializeConfig() {
429430
hw_btn_ins_0_macros.add(macroButton);
430431
hw_btn_ins_0_macros.add(macroLongPress);
431432
hw_btn_ins_0_macros.add(macroDoublePress);
433+
#endif
432434

435+
#if defined(IRPIN) && IRPIN > -1
433436
JsonObject hw_ir = hw.createNestedObject("ir");
434437
hw_ir[F("pin")] = IR_PIN;
435438
hw_ir[F("type")] = 0;
439+
#endif
436440

441+
#if defined(RLYPIN) && RLYPIN > -1
437442
JsonObject hw_relay = hw.createNestedObject("relay");
438443
hw_relay[F("pin")] = RLYPIN;
439444
hw_relay[F("rev")] = (RLYMDE) ? false : true;
440445
JsonObject hw_status = hw.createNestedObject("status");
441446
hw_status[F("pin")] = -1;
447+
#endif
442448

443449
JsonObject light = doc.createNestedObject("light");
444450
light[F("scale-bri")] = briMultiplier;

0 commit comments

Comments
 (0)