File tree Expand file tree Collapse file tree 3 files changed +32
-5
lines changed
targets/TARGET_NUVOTON/TARGET_M2351 Expand file tree Collapse file tree 3 files changed +32
-5
lines changed Original file line number Diff line number Diff line change @@ -197,6 +197,18 @@ void SYS_UnlockReg_S(void)
197
197
SYS_UnlockReg ();
198
198
}
199
199
200
+ __NONSECURE_ENTRY
201
+ void CLK_Idle_S (void )
202
+ {
203
+ CLK_Idle ();
204
+ }
205
+
206
+ __NONSECURE_ENTRY
207
+ void CLK_PowerDown_S (void )
208
+ {
209
+ CLK_PowerDown ();
210
+ }
211
+
200
212
static bool check_mod_ns (int modclass , uint32_t modidx )
201
213
{
202
214
const nu_modidx_ns_t * modidx_ns = modidx_ns_tab ;
Original file line number Diff line number Diff line change @@ -71,6 +71,14 @@ void SYS_LockReg_S(void);
71
71
__NONSECURE_ENTRY
72
72
void SYS_UnlockReg_S (void );
73
73
74
+ /* Secure CLK_Idle */
75
+ __NONSECURE_ENTRY
76
+ void CLK_Idle_S (void );
77
+
78
+ /* Secure CLK_PowerDown */
79
+ __NONSECURE_ENTRY
80
+ void CLK_PowerDown_S (void );
81
+
74
82
#ifdef __cplusplus
75
83
}
76
84
#endif
Original file line number Diff line number Diff line change 24
24
#include "PeripheralPins.h"
25
25
#include <stdbool.h>
26
26
27
- #if defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3U )
28
-
29
27
#if DEVICE_SERIAL
30
28
bool serial_can_deep_sleep (void );
31
29
#endif
32
30
33
31
/**
34
32
* Enter idle mode, in which just CPU is halted.
35
33
*/
36
- __NONSECURE_ENTRY
37
34
void hal_sleep (void )
38
35
{
36
+ #if defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3U )
39
37
SYS_UnlockReg ();
40
38
CLK_Idle ();
41
39
SYS_LockReg ();
40
+ #else
41
+ SYS_UnlockReg_S ();
42
+ CLK_Idle_S ();
43
+ SYS_LockReg_S ();
44
+ #endif
42
45
}
43
46
44
47
/**
45
48
* Enter power-down mode, in which HXT/HIRC are halted.
46
49
*/
47
- __NONSECURE_ENTRY
48
50
void hal_deepsleep (void )
49
51
{
50
52
#if DEVICE_SERIAL
@@ -53,10 +55,15 @@ void hal_deepsleep(void)
53
55
}
54
56
#endif
55
57
58
+ #if defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3U )
56
59
SYS_UnlockReg ();
57
60
CLK_PowerDown ();
58
61
SYS_LockReg ();
62
+ #else
63
+ SYS_UnlockReg_S ();
64
+ CLK_PowerDown_S ();
65
+ SYS_LockReg_S ();
66
+ #endif
59
67
}
60
68
61
69
#endif
62
- #endif
You can’t perform that action at this time.
0 commit comments