diff --git a/project/example/ble/ble_peripheral/app/src/bridge_pwm.c b/project/example/ble/ble_peripheral/app/src/bridge_pwm.c index 339e384..ab69e25 100644 --- a/project/example/ble/ble_peripheral/app/src/bridge_pwm.c +++ b/project/example/ble/ble_peripheral/app/src/bridge_pwm.c @@ -16,15 +16,15 @@ * Dual-color output uses one fixed 1 ms frame: * OFF -> W pulse -> OFF -> C pulse -> OFF to frame end. * The available OFF time is distributed around both direction changes and - * each W/C transition retains at least 50 us protection. + * each W/C transition retains at least 25 us protection. * Both non-zero colors therefore produce exactly one pulse per frame (1 kHz). */ #define BRIDGE_PWM_SCALE 1000U #define BRIDGE_PWM_PERIOD 7U #define BRIDGE_MIX_SCALE 1000U #define BRIDGE_FRAME_US 1000U -#define BRIDGE_DEADTIME_US 50U -#define BRIDGE_DUAL_ACTIVE_US 900U +#define BRIDGE_DEADTIME_US 25U +#define BRIDGE_DUAL_ACTIVE_US 950U #define BRIDGE_MIN_DUAL_PULSE_US 15U #define BRIDGE_TIMER_TICKS_PER_US 16U @@ -321,7 +321,7 @@ __RAM_CODE void Bridge_Service_1ms(void) if (cached_w_mix != w_mix || cached_c_mix != c_mix || output_mode != BRIDGE_MODE_DUAL) { /* - * Keep 100 us OFF at maximum dual-color brightness. The OFF time is + * Keep 50 us OFF at maximum dual-color brightness. The OFF time is * split evenly between W->C and C->W, which both absorbs interrupt * latency and spreads the two optical pulses across the 1 ms frame. */ diff --git a/project/example/ble/ble_peripheral/app/src/light_transition.c b/project/example/ble/ble_peripheral/app/src/light_transition.c index 0638635..0114680 100644 --- a/project/example/ble/ble_peripheral/app/src/light_transition.c +++ b/project/example/ble/ble_peripheral/app/src/light_transition.c @@ -8,7 +8,7 @@ volatile uint8_t Light_Transition_FadeActive; #define OUTPUT_SMOOTH_SHIFT 4U #define LIGHT_OUTPUT_SCALE 1000U #define BREATH_MIN_OUTPUT (LIGHT_OUTPUT_SCALE / 100U) -#define DUAL_MIN_COMBINED_OUTPUT (LIGHT_OUTPUT_SCALE / 10U) +#define DUAL_MIN_COMBINED_OUTPUT ((LIGHT_OUTPUT_SCALE * 12U) / 100U) #define DUAL_MIN_STABLE_CHANNEL_OUTPUT 17U #define POWER_FADE_Q12_MAX 4096U #define POWER_FADE_ON_TICKS 140U @@ -225,8 +225,8 @@ void Light_Transition_Task(void) (LIGHT_OUTPUT_SCALE / 100U) + 2048U) >> 12); /* - * Mixed light starts from a 10% combined floor. If the weaker direction - * would be below 17/1000 (about 15 us of the 900 us active window), raise + * Mixed light starts from a 12% combined floor. If the weaker direction + * would be below 17/1000 (about 16 us of the 950 us active window), raise * the combined floor just enough to preserve the requested W:C ratio. * Ratios that cannot satisfy this even at 100% are treated as single * color. Single-color output keeps the 1% Gamma minimum.