File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -271,9 +271,24 @@ void clear_temp_status() {
271271 #endif
272272 #endif
273273 #if defined(CP_RGB_STATUS_LED )
274- common_hal_pulseio_pwmout_set_duty_cycle (& rgb_status_r , status_rgb_color [0 ]);
275- common_hal_pulseio_pwmout_set_duty_cycle (& rgb_status_g , status_rgb_color [1 ]);
276- common_hal_pulseio_pwmout_set_duty_cycle (& rgb_status_b , status_rgb_color [2 ]);
274+
275+ uint16_t red = 0 ;
276+ uint16_t green = 0 ;
277+ uint16_t blue = 0 ;
278+
279+ #if defined(CP_RGB_STATUS_INVERTED_PWM )
280+ red = (1 << 16 ) - 1 - status_rgb_color [0 ];
281+ green = (1 << 16 ) - 1 - status_rgb_color [1 ];
282+ blue = (1 << 16 ) - 1 - status_rgb_color [2 ];
283+ #else
284+ red = status_rgb_color [0 ];
285+ green = status_rgb_color [1 ];
286+ blue = status_rgb_color [2 ];
287+ #endif
288+
289+ common_hal_pulseio_pwmout_set_duty_cycle (& rgb_status_r , red );
290+ common_hal_pulseio_pwmout_set_duty_cycle (& rgb_status_g , green );
291+ common_hal_pulseio_pwmout_set_duty_cycle (& rgb_status_b , blue );
277292 #endif
278293}
279294
You can’t perform that action at this time.
0 commit comments