+/*
+ * Mode stabilization:
+ * when changing brightness via pwmled_set_brightness() below,
+ * we want to converge to the target value as fast as possible. Also,
+ * we would like to somehow initialize the mode 3, which is used as
+ * "mode 2 + other PWMLED on". So after the brightness is set,
+ * we also set pwmleds[n].modes_not_yet_stable to MODE_STABILIZATION_TIME.
+ * When modes_not_yet_stable is non-zero, we allow only mode 2 to be set
+ * regardless of what is fed to pwmled_set_mode. We will then converge
+ * to the target value of mode 2 only, and after MODE_STABILIZATION_TIME
+ * ADC measurements, we copy the mode_pwm value to all other modes.
+ * Only then it is allowed to set the other modes.
+ */
+#define MODE_STABILIZATION_TIME (2*16) // two seconds worth of measurements
+