Skip to content

Commit

Permalink
Merge branch 'fix/lightbulb_incorrect_type' into 'master'
Browse files Browse the repository at this point in the history
fix(lightbulb): incorrect type

See merge request ae_group/esp-iot-solution!953
  • Loading branch information
Yuan Ming Fu committed Feb 5, 2024
2 parents 65c3166 + 9a2e4ca commit 1da71ee
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 13 deletions.
6 changes: 6 additions & 0 deletions components/led/lightbulb_driver/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# ChangeLog

## v1.1.2 - 2024-02-05

### Bug Fixes:

* fix(lightbulb): incorrect type.

## v1.1.1 - 2024-02-04

### Bug Fixes:
Expand Down
8 changes: 4 additions & 4 deletions components/led/lightbulb_driver/drivers/sm2x35egh/sm2x35egh.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,11 @@ sm2x35egh_rgb_current_t sm2235egh_rgb_current_mapping(int current_mA)
return (sm2x35egh_rgb_current_t)((current_mA - 4) / 4);
}

sm2x35egh_rgb_current_t sm2235egh_cw_current_mapping(int current_mA)
sm2x35egh_cw_current_t sm2235egh_cw_current_mapping(int current_mA)
{
DRIVER_CHECK((current_mA >= 5) && (current_mA <= 80) && (!(current_mA % 5)), "The current value is incorrect and cannot be mapped.", return SM2235EGH_CW_CURRENT_MAX);

return (sm2x35egh_rgb_current_t)((current_mA - 5) / 5);
return (sm2x35egh_cw_current_t)((current_mA - 5) / 5);
}

sm2x35egh_rgb_current_t sm2335egh_rgb_current_mapping(int current_mA)
Expand All @@ -215,11 +215,11 @@ sm2x35egh_rgb_current_t sm2335egh_rgb_current_mapping(int current_mA)
return (sm2x35egh_rgb_current_t)((current_mA - 10) / 10);
}

sm2x35egh_rgb_current_t sm2335egh_cw_current_mapping(int current_mA)
sm2x35egh_cw_current_t sm2335egh_cw_current_mapping(int current_mA)
{
DRIVER_CHECK((current_mA >= 5) && (current_mA <= 80) && (!(current_mA % 5)), "The current value is incorrect and cannot be mapped.", return SM2335EGH_CW_CURRENT_MAX);

return (sm2x35egh_rgb_current_t)((current_mA - 5) / 5);
return (sm2x35egh_cw_current_t)((current_mA - 5) / 5);
}

esp_err_t sm2x35egh_init(driver_sm2x35egh_t *config, void(*hook_func)(void *))
Expand Down
8 changes: 4 additions & 4 deletions components/led/lightbulb_driver/drivers/sm2x35egh/sm2x35egh.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ sm2x35egh_rgb_current_t sm2235egh_rgb_current_mapping(int current_mA);
* @brief Convert the cw channel current value into the enumeration value required by the driver
*
* @param current_mA Drive current value, in milliamps, ranges from 5~80mA, and can be evenly divided by 5
* @return sm2x35egh_rgb_current_t
* @return sm2x35egh_cw_current_t
*/
sm2x35egh_rgb_current_t sm2235egh_cw_current_mapping(int current_mA);
sm2x35egh_cw_current_t sm2235egh_cw_current_mapping(int current_mA);

/**
* @brief Convert the rgb channel current value into the enumeration value required by the driver
Expand All @@ -237,6 +237,6 @@ sm2x35egh_rgb_current_t sm2335egh_rgb_current_mapping(int current_mA);
* @brief Convert the cw channel current value into the enumeration value required by the driver
*
* @param current_mA Drive current value, in milliamps, ranges from 5~80mA, and can be evenly divided by 5
* @return sm2x35egh_rgb_current_t
* @return sm2x35egh_cw_current_t
*/
sm2x35egh_rgb_current_t sm2335egh_cw_current_mapping(int current_mA);
sm2x35egh_cw_current_t sm2335egh_cw_current_mapping(int current_mA);
2 changes: 1 addition & 1 deletion components/led/lightbulb_driver/idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "1.1.1"
version: "1.1.2"
description: Provide multiple dimming driver solutions to easily build lightbulb applications
url: https://github.com/espressif/esp-iot-solution/tree/master/components/led/lightbulb_driver
dependencies:
Expand Down
8 changes: 4 additions & 4 deletions components/led/lightbulb_driver/include/lightbulb.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
#include <hal/gpio_hal.h>
#include <esp_log.h>

#ifdef __cplusplus
extern "C" {
#endif

#ifdef CONFIG_ENABLE_PWM_DRIVER
#include "pwm.h"
#endif
Expand Down Expand Up @@ -42,10 +46,6 @@
#include "kp18058.h"
#endif

#ifdef __cplusplus
extern "C" {
#endif

/**
* @brief Supported drivers
*
Expand Down

0 comments on commit 1da71ee

Please sign in to comment.