mbed library sources. Supersedes mbed-src. Fixed broken STM32F1xx RTC on rtc_api.c

Dependents:   Nucleo_F103RB_RTC_battery_bkup_pwr_off_okay

Fork of mbed-dev by mbed official

Revision:
172:7d866c31b3c5
Parent:
170:19eb464bc2be
diff -r 89b338f31ef1 -r 7d866c31b3c5 targets/TARGET_NXP/TARGET_LPC43XX/spi_api.c
--- a/targets/TARGET_NXP/TARGET_LPC43XX/spi_api.c	Wed Aug 16 18:27:13 2017 +0100
+++ b/targets/TARGET_NXP/TARGET_LPC43XX/spi_api.c	Thu Aug 31 17:27:04 2017 +0100
@@ -117,7 +117,7 @@
     
     int FRF = 0;                   // FRF (frame format) = SPI
     uint32_t tmp = obj->spi->CR0;
-    tmp &= ~(0xFFFF);
+    tmp &= ~(0x00FF);              // Clear DSS, FRF, CPOL and CPHA [7:0]
     tmp |= DSS << 0
         | FRF << 4
         | SPO << 6
@@ -152,7 +152,7 @@
             obj->spi->CPSR = prescaler;
             
             // divider
-            obj->spi->CR0 &= ~(0xFFFF << 8);
+            obj->spi->CR0 &= ~(0xFF00);  // Clear SCR: Serial clock rate [15:8]
             obj->spi->CR0 |= (divider - 1) << 8;
             ssp_enable(obj);
             return;