File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (c) 2025 Linumiz GmbH
3+ *
4+ * SPDX-License-Identifier: Apache-2.0
5+ */
6+
7+ #include <zephyr/kernel.h>
8+ #include <zephyr/sys/poweroff.h>
9+ #include <zephyr/toolchain.h>
10+ #include <zephyr/drivers/hwinfo.h>
11+ #include <soc.h>
12+
13+ #include <ti/driverlib/driverlib.h>
14+
15+ void z_sys_poweroff (void )
16+ {
17+ DL_SYSCTL_setPowerPolicySHUTDOWN ();
18+ __WFI ();
19+
20+ CODE_UNREACHABLE ;
21+ }
22+
23+ static int ti_mspm0l2xxx_poweroff_init (void )
24+ {
25+ int ret ;
26+ uint32_t rst_cause ;
27+
28+ ret = hwinfo_get_reset_cause (& rst_cause );
29+ if (ret != 0 ) {
30+ return ret ;
31+ }
32+
33+ if (RESET_LOW_POWER_WAKE == rst_cause ) {
34+ DL_SYSCTL_releaseShutdownIO ();
35+ }
36+
37+ return 0 ;
38+ }
39+ SYS_INIT (ti_mspm0l2xxx_poweroff_init , POST_KERNEL , 0 );
You can’t perform that action at this time.
0 commit comments