mbed library sources. Supersedes mbed-src.

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

Revision:
163:74e0ce7f98e8
Parent:
153:fa9ff456f731
Child:
179:b0033dcd6934
--- a/targets/TARGET_NUVOTON/TARGET_NUC472/trng_api.c	Wed Apr 12 16:21:43 2017 +0100
+++ b/targets/TARGET_NUVOTON/TARGET_NUC472/trng_api.c	Fri Apr 28 14:04:18 2017 +0100
@@ -31,12 +31,16 @@
  * Get Random number generator.
  */
 static volatile int  g_PRNG_done;
+volatile int  g_AES_done;
 
 void CRYPTO_IRQHandler()
 {
     if (PRNG_GET_INT_FLAG()) {
         g_PRNG_done = 1;
         PRNG_CLR_INT_FLAG();
+    }  else if (AES_GET_INT_FLAG()) {
+        g_AES_done = 1;
+        AES_CLR_INT_FLAG();
     }
 } 
 
@@ -86,7 +90,7 @@
         memcpy(output, &tmpBuff, length);
         *output_length = length;
     } else {
-        for (size_t i = 0; i < (length/32); i++) {
+        for (int i = 0; i < (length/32); i++) {
             trng_get(output);
             *output_length += 32;
             output += 32;