Skip to content

Commit 8493c61

Browse files
author
Cruz Monrreal
authored
Merge pull request #9191 from OpenNuvoton/nuvoton_fix_crypto_no-rtos
Nuvoton: Fix crypto compile error with Mbed OS 2
2 parents 57c2079 + ad1e57b commit 8493c61

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

targets/TARGET_NUVOTON/TARGET_M480/crypto/crypto-misc.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,16 @@
1919
#include "mbed_assert.h"
2020
#include "mbed_critical.h"
2121
#include "mbed_error.h"
22+
#if MBED_CONF_RTOS_PRESENT
2223
#include "cmsis_os2.h"
23-
#include "mbed_rtos_storage.h"
24+
#endif
2425
#include <string.h>
2526
#include <limits.h>
2627
#include "nu_modutil.h"
2728
#include "nu_bitutil.h"
2829
#include "crypto-misc.h"
29-
#include "SingletonPtr.h"
30-
#include "Mutex.h"
30+
#include "platform/SingletonPtr.h"
31+
#include "platform/PlatformMutex.h"
3132

3233
/* Consideration for choosing proper synchronization mechanism
3334
*
@@ -46,13 +47,13 @@
4647
*/
4748

4849
/* Mutex for crypto AES AC management */
49-
static SingletonPtr<rtos::Mutex> crypto_aes_mutex;
50+
static SingletonPtr<PlatformMutex> crypto_aes_mutex;
5051

5152
/* Mutex for crypto DES AC management */
52-
static SingletonPtr<rtos::Mutex> crypto_des_mutex;
53+
static SingletonPtr<PlatformMutex> crypto_des_mutex;
5354

5455
/* Mutex for crypto ECC AC management */
55-
static SingletonPtr<rtos::Mutex> crypto_ecc_mutex;
56+
static SingletonPtr<PlatformMutex> crypto_ecc_mutex;
5657

5758
/* Atomic flag for crypto SHA AC management */
5859
static core_util_atomic_flag crypto_sha_atomic_flag = CORE_UTIL_ATOMIC_FLAG_INIT;

targets/TARGET_NUVOTON/TARGET_NUC472/crypto/crypto-misc.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,16 @@
1919
#include "mbed_assert.h"
2020
#include "mbed_critical.h"
2121
#include "mbed_error.h"
22+
#if MBED_CONF_RTOS_PRESENT
2223
#include "cmsis_os2.h"
23-
#include "mbed_rtos_storage.h"
24+
#endif
2425
#include <string.h>
2526
#include <limits.h>
2627
#include "nu_modutil.h"
2728
#include "nu_bitutil.h"
2829
#include "crypto-misc.h"
29-
#include "SingletonPtr.h"
30-
#include "Mutex.h"
30+
#include "platform/SingletonPtr.h"
31+
#include "platform/PlatformMutex.h"
3132

3233
/* Consideration for choosing proper synchronization mechanism
3334
*
@@ -44,12 +45,12 @@
4445
* (2) No biting CPU
4546
* Same reason as above.
4647
*/
47-
48+
4849
/* Mutex for crypto AES AC management */
49-
static SingletonPtr<rtos::Mutex> crypto_aes_mutex;
50+
static SingletonPtr<PlatformMutex> crypto_aes_mutex;
5051

5152
/* Mutex for crypto DES AC management */
52-
static SingletonPtr<rtos::Mutex> crypto_des_mutex;
53+
static SingletonPtr<PlatformMutex> crypto_des_mutex;
5354

5455
/* Atomic flag for crypto SHA AC management */
5556
static core_util_atomic_flag crypto_sha_atomic_flag = CORE_UTIL_ATOMIC_FLAG_INIT;

0 commit comments

Comments
 (0)