Skip to content

Commit

Permalink
minipack: fix sim led handler issue (facebook#104)
Browse files Browse the repository at this point in the history
Summary:
SIM led may not change in time if interval(0) - 1 = 255.
Pull Request resolved: facebookexternal/openbmc.accton#104

Test Plan: Build and verify on minipack system.

Reviewed By: benwei13

fbshipit-source-id: 2d433ea30
  • Loading branch information
mikechoifb authored and facebook-github-bot committed Nov 1, 2018
1 parent 2e49d25 commit 7eedcc5
Showing 1 changed file with 28 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -299,29 +299,37 @@ simLED_monitor_handler(void *unused) {
while(1) {
sleep(1);
pal_mon_fw_upgrade(brd_rev, &sys_ug, &fan_ug, &psu_ug, &smb_ug);
if(sys_ug == 0 && interval[0] == 0) {
interval[0] = INTERVAL_MAX;
set_sys_led(brd_rev);
} else {
interval[0]--;
if (sys_ug == 0) {
if (interval[0] == 0) {
interval[0] = INTERVAL_MAX;
set_sys_led(brd_rev);
} else {
interval[0]--;
}
}
if(fan_ug == 0 && interval[1] == 0) {
interval[1] = INTERVAL_MAX;
set_fan_led(brd_rev);
} else {
interval[1]--;
if (fan_ug == 0) {
if (interval[1] == 0) {
interval[1] = INTERVAL_MAX;
set_fan_led(brd_rev);
} else {
interval[1]--;
}
}
if(psu_ug == 0 && interval[2] == 0) {
interval[2] = INTERVAL_MAX;
set_psu_led(brd_rev);
} else {
interval[2]--;
if (psu_ug == 0) {
if (interval[2] == 0) {
interval[2] = INTERVAL_MAX;
set_psu_led(brd_rev);
} else {
interval[2]--;
}
}
if(smb_ug == 0 && interval[3] == 0) {
interval[3] = INTERVAL_MAX;
set_smb_led(brd_rev);
} else {
interval[3]--;
if (smb_ug == 0) {
if (interval[3] == 0) {
interval[3] = INTERVAL_MAX;
set_smb_led(brd_rev);
} else {
interval[3]--;
}
}
}
return 0;
Expand Down

0 comments on commit 7eedcc5

Please sign in to comment.