You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: targets/TARGET_NUVOTON/TARGET_M451/device/TOOLCHAIN_GCC_ARM/m451_retarget.c
+5-2Lines changed: 5 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -11,10 +11,13 @@
11
11
12
12
#include"M451Series.h"
13
13
#include<errno.h>
14
+
#include"nu_miscutil.h"
14
15
15
16
externuint32_t__mbed_sbrk_start;
16
17
externuint32_t__mbed_krbs_start;
17
18
19
+
#defineNU_HEAP_ALIGN 32
20
+
18
21
/**
19
22
* The default implementation of _sbrk() (in common/retarget.cpp) for GCC_ARM requires one-region model (heap and stack share one region), which doesn't
20
23
* fit two-region model (heap and stack are two distinct regions), for example, NUMAKER-PFM-NUC472 locates heap on external SRAM. Define __wrap__sbrk() to
// TODO: Check if other peripherals allow entering power-down mode
80
-
81
-
obj->start_us=lp_ticker_read();
82
-
// Let us_ticker prepare for power-down or reject it.
83
-
us_ticker_prepare_sleep(obj);
84
-
85
-
// NOTE(STALE): To pass mbed-drivers test, timer requires to be fine-grained, so its implementation needs HIRC rather than LIRC/LXT as its clock source.
86
-
// But as CLK_PowerDown()/CLK_Idle() is called, HIRC will be disabled and timer cannot keep counting and alarm. To overcome the dilemma,
87
-
// just make CPU halt and compromise power saving.
88
-
// NOTE: As CLK_PowerDown()/CLK_Idle() is called, HIRC/HXT will be disabled in normal mode, but not in ICE mode. This may cause confusion in development.
89
-
77
+
90
78
if (obj->powerdown) { // Power-down mode (HIRC/HXT disabled, LIRC/LXT enabled)
* This event was in the past. Set the interrupt as pending, but don't process it here.
174
162
* This prevents a recurive loop under heavy load which can lead to a stack overflow.
175
163
*/
176
-
NVIC_SetPendingIRQ(timer1lores_modinit.irq_n);
164
+
NVIC_SetPendingIRQ(timer1hires_modinit.irq_n);
177
165
}
178
166
}
179
167
180
-
voidus_ticker_prepare_sleep(structsleep_s*obj)
181
-
{
182
-
// Reject power-down if hi-res timer (HIRC/HXT) is now armed for CD counter.
183
-
if (obj->powerdown) {
184
-
obj->powerdown= ! cd_hires_tmr_armed;
185
-
}
186
-
187
-
core_util_critical_section_enter();
188
-
189
-
if (obj->powerdown) {
190
-
// NOTE: On entering power-down mode, HIRC/HXT will be disabled in normal mode, but not in ICE mode. This may cause confusion in development.
191
-
// To not be inconsistent due to above, always disable clock source of normal counter, and then re-enable it and make compensation on wakeup from power-down.
Copy file name to clipboardExpand all lines: targets/TARGET_NUVOTON/TARGET_NUC472/device/TOOLCHAIN_GCC_ARM/nuc472_retarget.c
+5-2Lines changed: 5 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -11,10 +11,13 @@
11
11
12
12
#include"NUC472_442.h"
13
13
#include<errno.h>
14
+
#include"nu_miscutil.h"
14
15
15
16
externuint32_t__mbed_sbrk_start;
16
17
externuint32_t__mbed_krbs_start;
17
18
19
+
#defineNU_HEAP_ALIGN 32
20
+
18
21
/**
19
22
* The default implementation of _sbrk() (in common/retarget.cpp) for GCC_ARM requires one-region model (heap and stack share one region), which doesn't
20
23
* fit two-region model (heap and stack are two distinct regions), for example, NUMAKER-PFM-NUC472 locates heap on external SRAM. Define __wrap__sbrk() to
// TODO: Check if other peripherals allow entering power-down mode
79
77
80
-
obj->start_us=lp_ticker_read();
81
-
// Let us_ticker prepare for power-down or reject it.
82
-
us_ticker_prepare_sleep(obj);
83
-
84
-
// NOTE(STALE): To pass mbed-drivers test, timer requires to be fine-grained, so its implementation needs HIRC rather than LIRC/LXT as its clock source.
85
-
// But as CLK_PowerDown()/CLK_Idle() is called, HIRC will be disabled and timer cannot keep counting and alarm. To overcome the dilemma,
86
-
// just make CPU halt and compromise power saving.
87
-
// NOTE: As CLK_PowerDown()/CLK_Idle() is called, HIRC/HXT will be disabled in normal mode, but not in ICE mode. This may cause confusion in development.
88
-
89
78
if (obj->powerdown) { // Power-down mode (HIRC/HXT disabled, LIRC/LXT enabled)
0 commit comments