aboutsummaryrefslogtreecommitdiff
path: root/hw/ds1338.c
diff options
context:
space:
mode:
authorAntoine Mathys <barsamin@gmail.com>2012-12-13 14:05:27 +0000
committerPeter Maydell <peter.maydell@linaro.org>2012-12-13 14:05:27 +0000
commit580f5c000809108f51a77ae74709100d32be6ea5 (patch)
tree7ec5c7a05f10e536dc2014d85efb72584fa6995b /hw/ds1338.c
parent97331270e50f5858c82a0c6d146da81f5b776535 (diff)
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>
Diffstat (limited to 'hw/ds1338.c')
-rw-r--r--hw/ds1338.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/ds1338.c b/hw/ds1338.c
index b576d56438..faaa4a0a93 100644
--- a/hw/ds1338.c
+++ b/hw/ds1338.c
@@ -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);
}