Skip to content

Commit

Permalink
删除无用变量
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiu-xiao committed Feb 1, 2024
1 parent c86e482 commit 2a74caa
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/device/led_rgb/dev_led_rgb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

using namespace Device;

static uint32_t led_stats;

RGB::RGB(bool auto_start) {
bsp_pwm_start(BSP_PWM_LED_RED);
bsp_pwm_start(BSP_PWM_LED_BLU);
Expand Down Expand Up @@ -36,6 +34,9 @@ RGB::RGB(bool auto_start) {
led->Set(BLUE, 1);
led_fsm = 0;
break;
default:
led_fsm = 0;
break;
}

led->thread_.SleepUntil(250, last_online_time);
Expand All @@ -51,25 +52,20 @@ RGB::RGB(bool auto_start) {
bool RGB::Set(RGB::Channel ch, float duty_cycle) {
clampf(&duty_cycle, 0.0f, 1.0f);

bsp_pwm_channel_t pwm_ch = BSP_PWM_NUMBER;

switch (ch) {
case RED:
bsp_pwm_set_comp(BSP_PWM_LED_RED, duty_cycle);
pwm_ch = BSP_PWM_LED_RED;
break;

case GREEN:
bsp_pwm_set_comp(BSP_PWM_LED_GRN, duty_cycle);
pwm_ch = BSP_PWM_LED_GRN;
break;

case BLUE:
bsp_pwm_set_comp(BSP_PWM_LED_BLU, duty_cycle);
pwm_ch = BSP_PWM_LED_BLU;
break;
default:
pwm_ch = BSP_PWM_LED_RED;
break;
}

return true;
Expand Down

0 comments on commit 2a74caa

Please sign in to comment.