aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/platforms/STM32/RTCv2
diff options
context:
space:
mode:
authorbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-09-20 18:33:44 +0000
committerbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-09-20 18:33:44 +0000
commitbd58700cd5cefa8ec2d5e66a5a7937f774e617f2 (patch)
tree0ba8d2fdc5ea9136633f0bc98def0caf2c596f6c /os/hal/platforms/STM32/RTCv2
parent406ee2993e054209845889ced5e36ab17b423bea (diff)
downloadChibiOS-bd58700cd5cefa8ec2d5e66a5a7937f774e617f2.tar.gz
ChibiOS-bd58700cd5cefa8ec2d5e66a5a7937f774e617f2.tar.bz2
ChibiOS-bd58700cd5cefa8ec2d5e66a5a7937f774e617f2.zip
RTCv2. Added locks for thread safety.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4703 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/STM32/RTCv2')
-rw-r--r--os/hal/platforms/STM32/RTCv2/rtc_lld.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/os/hal/platforms/STM32/RTCv2/rtc_lld.c b/os/hal/platforms/STM32/RTCv2/rtc_lld.c
index 1fe433324..48a81dd96 100644
--- a/os/hal/platforms/STM32/RTCv2/rtc_lld.c
+++ b/os/hal/platforms/STM32/RTCv2/rtc_lld.c
@@ -281,7 +281,10 @@ uint32_t rtc_lld_get_time_fat(RTCDriver *rtcp) {
uint32_t tv_date;
uint32_t v;
- rtc_lld_get_time(rtcp, &timespec);
+ chSysLock();
+ rtcGetTimeI(rtcp, &timespec);
+ chSysUnlock();
+
tv_time = timespec.tv_time;
tv_date = timespec.tv_date;