File tree 1 file changed +10
-6
lines changed
companion/src/firmwares/edgetx
1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -1489,16 +1489,20 @@ bool convert<ModelData>::decode(const Node& node, ModelData& rhs)
1489
1489
node[" switchNames" ] >> rhs.functionSwitchNames ;
1490
1490
if (node[" functionSwitchLedONColor" ]) {
1491
1491
for (int i = 0 ; i < CPN_MAX_SWITCHES_FUNCTION; i += 1 ) {
1492
- node[" functionSwitchLedONColor" ][std::to_string (i)][" r" ] >> rhs.functionSwitchLedONColor [i].r ;
1493
- node[" functionSwitchLedONColor" ][std::to_string (i)][" g" ] >> rhs.functionSwitchLedONColor [i].g ;
1494
- node[" functionSwitchLedONColor" ][std::to_string (i)][" b" ] >> rhs.functionSwitchLedONColor [i].b ;
1492
+ if (node[" functionSwitchLedONColor" ][std::to_string (i)]) {
1493
+ node[" functionSwitchLedONColor" ][std::to_string (i)][" r" ] >> rhs.functionSwitchLedONColor [i].r ;
1494
+ node[" functionSwitchLedONColor" ][std::to_string (i)][" g" ] >> rhs.functionSwitchLedONColor [i].g ;
1495
+ node[" functionSwitchLedONColor" ][std::to_string (i)][" b" ] >> rhs.functionSwitchLedONColor [i].b ;
1496
+ }
1495
1497
}
1496
1498
}
1497
1499
if (node[" functionSwitchLedOFFColor" ]) {
1498
1500
for (int i = 0 ; i < CPN_MAX_SWITCHES_FUNCTION; i += 1 ) {
1499
- node[" functionSwitchLedOFFColor" ][std::to_string (i)][" r" ] >> rhs.functionSwitchLedOFFColor [i].r ;
1500
- node[" functionSwitchLedOFFColor" ][std::to_string (i)][" g" ] >> rhs.functionSwitchLedOFFColor [i].g ;
1501
- node[" functionSwitchLedOFFColor" ][std::to_string (i)][" b" ] >> rhs.functionSwitchLedOFFColor [i].b ;
1501
+ if (node[" functionSwitchLedOFFColor" ][std::to_string (i)]) {
1502
+ node[" functionSwitchLedOFFColor" ][std::to_string (i)][" r" ] >> rhs.functionSwitchLedOFFColor [i].r ;
1503
+ node[" functionSwitchLedOFFColor" ][std::to_string (i)][" g" ] >> rhs.functionSwitchLedOFFColor [i].g ;
1504
+ node[" functionSwitchLedOFFColor" ][std::to_string (i)][" b" ] >> rhs.functionSwitchLedOFFColor [i].b ;
1505
+ }
1502
1506
}
1503
1507
}
1504
1508
You can’t perform that action at this time.
0 commit comments