CYTFM_064B0S2_4343W: use cytfm_flash only if TFM and PSA are present

This fixes bare metal builds
pull/13864/head
Lingkai Dong 2020-11-04 18:25:13 +00:00
parent 77638f9b72
commit 7641f1cb3c
2 changed files with 3 additions and 3 deletions

View File

@ -26,7 +26,7 @@
#include "region_defs.h" #include "region_defs.h"
#include "cytfm_flash_info.h" #include "cytfm_flash_info.h"
#if DEVICE_FLASH #if DEVICE_FLASH && defined(TARGET_TFM) && MBED_CONF_PSA_PRESENT
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

View File

@ -17,7 +17,7 @@
#include "flash_api.h" #include "flash_api.h"
#include "cyhal_flash.h" #include "cyhal_flash.h"
#ifdef TARGET_TFM #if defined(TARGET_TFM) && MBED_CONF_PSA_PRESENT
#include "cytfm_flash_info.h" #include "cytfm_flash_info.h"
#endif #endif
@ -32,7 +32,7 @@ int32_t flash_init(flash_t *obj)
if (CY_RSLT_SUCCESS != cyhal_flash_init(&(obj->flash))) { if (CY_RSLT_SUCCESS != cyhal_flash_init(&(obj->flash))) {
return -1; return -1;
} }
#ifdef TARGET_TFM #if defined(TARGET_TFM) && MBED_CONF_PSA_PRESENT
cytfm_flash_get_info(&(obj->flash), &(obj->info)); cytfm_flash_get_info(&(obj->flash), &(obj->info));
#else /* TARGET_TFM */ #else /* TARGET_TFM */
cyhal_flash_get_info(&(obj->flash), &(obj->info)); cyhal_flash_get_info(&(obj->flash), &(obj->info));