Skip to content

Commit

Permalink
[BL602] Update button, not use dts to init (#20905)
Browse files Browse the repository at this point in the history
* [BL602] Update button, not use dts to init

* Restyled by clang-format

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
jczhang777 and restyled-commits authored Jul 19, 2022
1 parent ae4e105 commit ea78432
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/lighting-app/bouffalolab/bl602/src/LEDWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ bool LEDWidget::IsTurnedOn()
void LEDWidget::SetColor(uint8_t Hue, uint8_t Saturation)
{
uint8_t red, green, blue;
uint8_t brightness = mState ? mDefaultOnBrightness : 0;
uint8_t brightness = mDefaultOnBrightness;
mHue = static_cast<uint16_t>(Hue) * 360 / 254; // mHue [0, 360]
mSaturation = static_cast<uint16_t>(Saturation) * 100 / 254; // mSaturation [0 , 100]

Expand Down
7 changes: 1 addition & 6 deletions examples/platform/bouffalolab/bl602/InitPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,12 +282,7 @@ void InitPlatform(void)
{
bl_sys_init();

uint32_t fdt = 0, offset = 0;
if (0 == get_dts_addr("gpio", &fdt, &offset))
{
hal_gpio_init_from_dts(fdt, offset);
fdt_button_module_init((const void *) fdt, (int) offset);
}
hal_button_module_init(8, 1000, 4800, 5000);
Platform_Light_Init();
aos_register_event_filter(EV_KEY, event_cb_key_event, NULL);
}
Expand Down

0 comments on commit ea78432

Please sign in to comment.