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
Diff: targets/TARGET_NUVOTON/TARGET_NUC472/trng_api.c
- Revision:
- 163:74e0ce7f98e8
- Parent:
- 153:fa9ff456f731
--- 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;