mbed library sources. Supersedes mbed-src. Edited target satm32f446 for user USART3 pins

Dependents:   IGLOO_board

Fork of mbed-dev by mbed official

Revision:
184:08ed48f1de7f
Parent:
167:e84263d55307
--- a/targets/TARGET_NXP/TARGET_LPC43XX/rtc_api.c	Tue Mar 20 17:01:51 2018 +0000
+++ b/targets/TARGET_NXP/TARGET_LPC43XX/rtc_api.c	Thu Apr 19 17:12:19 2018 +0100
@@ -102,7 +102,10 @@
     timeinfo.tm_year = LPC_RTC->TIME[RTC_TIMETYPE_YEAR] - 1900;
     
     // Convert to timestamp
-    time_t t = _rtc_mktime(&timeinfo);
+    time_t t;
+    if (_rtc_maketime(&timeinfo, &t, RTC_4_YEAR_LEAP_YEAR_SUPPORT) == false) {
+        return 0;
+    }
     
     return t;
 }
@@ -110,10 +113,10 @@
 void rtc_write(time_t t) {
     // Convert the time in to a tm
     struct tm timeinfo;
-    if (_rtc_localtime(t, &timeinfo) == false) {
+    if (_rtc_localtime(t, &timeinfo, RTC_4_YEAR_LEAP_YEAR_SUPPORT) == false) {
         return;
     }
-    
+
     // Pause clock, and clear counter register (clears us count)
     LPC_RTC->CCR |= 2;