hw/ds1338.c: Correct bug in conversion to BCD.

Signed-off-by: Antoine Mathys <barsamin@gmail.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Antoine Mathys 2012-12-13 14:05:27 +00:00 committed by Peter Maydell
parent 97331270e5
commit 580f5c0008

View file

@ -57,9 +57,9 @@ static void capture_current_time(DS1338State *s)
} else {
s->nvram[2] = to_bcd(now.tm_hour);
}
s->nvram[3] = to_bcd(now.tm_wday) + 1;
s->nvram[3] = to_bcd(now.tm_wday + 1);
s->nvram[4] = to_bcd(now.tm_mday);
s->nvram[5] = to_bcd(now.tm_mon) + 1;
s->nvram[5] = to_bcd(now.tm_mon + 1);
s->nvram[6] = to_bcd(now.tm_year - 100);
}