mbed library sources. Supersedes mbed-src.

Dependents:   Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more

Revision:
188:bcfe06ba3d64
Parent:
187:0387e8f68319
Child:
189:f392fc9709a3
--- a/targets/TARGET_STM/serial_api.c	Thu Sep 06 13:40:20 2018 +0100
+++ b/targets/TARGET_STM/serial_api.c	Thu Nov 08 11:46:34 2018 +0000
@@ -354,7 +354,7 @@
             if (!__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY)) {
                 RCC_OscInitTypeDef RCC_OscInitStruct = {0};
                 RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE;
-                RCC_OscInitStruct.HSIState       = RCC_LSE_ON;
+                RCC_OscInitStruct.LSEState       = RCC_LSE_ON;
                 RCC_OscInitStruct.PLL.PLLState   = RCC_PLL_OFF;
                 HAL_RCC_OscConfig(&RCC_OscInitStruct);
             }
@@ -536,7 +536,9 @@
 #if defined(LPUART1_BASE)
     if (huart->Instance == LPUART1) {
         if (obj_s->baudrate <= 9600) {
+#if ((MBED_CONF_TARGET_LPUART_CLOCK_SOURCE) & USE_LPUART_CLK_LSE)            
             HAL_UARTEx_EnableClockStopMode(huart);
+#endif            
             HAL_UARTEx_EnableStopMode(huart);
         } else {
             HAL_UARTEx_DisableClockStopMode(huart);
@@ -660,10 +662,10 @@
     return -1;
 }
 
-/*  Function to protect deep sleep while a seral Tx is ongoing on not complete
- *  yet. Returns 1 if there is at least 1 serial instance with ongoing ransfer
- *  0 otherwise.
- */
+/* Function used to protect deep sleep while a serial transmission is on-going.
+.* Returns 1 if there is at least 1 serial instance with an on-going transfer
+ * and 0 otherwise.
+*/
 int serial_is_tx_ongoing(void) {
     int TxOngoing = 0;
 
@@ -757,8 +759,13 @@
     }
 #endif
 
-    /*  If Tx is ongoing, then transfer is */
     return TxOngoing;
 }
 
+#else
+
+int serial_is_tx_ongoing(void) {
+    return 0;
+}
+
 #endif /* DEVICE_SERIAL */