TRNG - protect HAL implementation if DEVICE_TRNG is not defined

pull/2765/head
Martin Kojtal 2016-09-22 11:41:58 +01:00
parent 9048113562
commit f8c6c23ced
4 changed files with 10 additions and 1 deletions

View File

@ -22,6 +22,8 @@
* Reference: "K64 Sub-Family Reference Manual, Rev. 2", chapter 34 * Reference: "K64 Sub-Family Reference Manual, Rev. 2", chapter 34
*/ */
#if defined(DEVICE_TRNG)
#include <stdlib.h> #include <stdlib.h>
#include "cmsis.h" #include "cmsis.h"
#include "fsl_common.h" #include "fsl_common.h"
@ -81,3 +83,5 @@ int trng_get_bytes(trng_t *obj, uint8_t *output, size_t length, size_t *output_l
return 0; return 0;
} }
#endif

View File

@ -18,6 +18,7 @@
* *
*/ */
#if DEVICE_TRNG
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -95,5 +96,5 @@ int trng_get_bytes(trng_t *obj, uint8_t *output, size_t length, size_t *output_l
return 0; return 0;
} }
#endif

View File

@ -18,6 +18,7 @@
* *
*/ */
#if defined(DEVICE_TRNG)
#if defined(TARGET_STM32F405xx) || defined(TARGET_STM32F415xx) || defined(TARGET_STM32F407xx) || defined(TARGET_STM32F417xx) ||\ #if defined(TARGET_STM32F405xx) || defined(TARGET_STM32F415xx) || defined(TARGET_STM32F407xx) || defined(TARGET_STM32F417xx) ||\
defined(TARGET_STM32F427xx) || defined(TARGET_STM32F437xx) || defined(TARGET_STM32F429xx) || defined(TARGET_STM32F439xx) ||\ defined(TARGET_STM32F427xx) || defined(TARGET_STM32F437xx) || defined(TARGET_STM32F429xx) || defined(TARGET_STM32F439xx) ||\
@ -78,3 +79,4 @@ int trng_get_bytes(trng_t *obj, uint8_t *output, size_t length, size_t *output_l
#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx ||\ #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx ||\
STM32F429xx || STM32F439xx || STM32F410xx || STM32F469xx || STM32F479xx */ STM32F429xx || STM32F439xx || STM32F410xx || STM32F469xx || STM32F479xx */
#endif

View File

@ -18,6 +18,7 @@
* *
*/ */
#if defined(DEVICE_TRNG)
#include <stdlib.h> #include <stdlib.h>
#include "cmsis.h" #include "cmsis.h"
@ -71,3 +72,4 @@ int trng_get_bytes(trng_t *obj, uint8_t *output, size_t length, size_t *output_l
return( ret ); return( ret );
} }
#endif