Skip to content

Commit 187e51b

Browse files
committed
user_interface.h - separate rst_info and rst_reason definitions
1 parent 78d0d0a commit 187e51b

File tree

2 files changed

+38
-21
lines changed

2 files changed

+38
-21
lines changed

tools/sdk/include/rst_info.h

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
Extracted from user_interface.h to avoid redundant exports
3+
*/
4+
5+
#pragma once
6+
7+
#include <c_types.h> // uint32
8+
9+
#ifdef __cplusplus
10+
extern "C" {
11+
#endif
12+
13+
enum rst_reason {
14+
REASON_DEFAULT_RST = 0, /* normal startup by power on */
15+
REASON_WDT_RST = 1, /* hardware watch dog reset */
16+
REASON_EXCEPTION_RST = 2, /* exception reset, GPIO status won’t change */
17+
REASON_SOFT_WDT_RST = 3, /* software watch dog reset, GPIO status won’t change */
18+
REASON_SOFT_RESTART = 4, /* software restart ,system_restart , GPIO status won’t change */
19+
REASON_DEEP_SLEEP_AWAKE = 5, /* wake up from deep-sleep */
20+
REASON_EXT_SYS_RST = 6 /* external system reset */
21+
};
22+
23+
struct rst_info{
24+
uint32 reason;
25+
uint32 exccause;
26+
uint32 epc1;
27+
uint32 epc2;
28+
uint32 epc3;
29+
uint32 excvaddr;
30+
uint32 depc;
31+
};
32+
33+
struct rst_info* system_get_rst_info(void);
34+
35+
#ifdef __cplusplus
36+
} // extern "C"
37+
#endif

tools/sdk/include/user_interface.h

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -54,27 +54,7 @@ extern "C" {
5454
#define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x"
5555
#endif
5656

57-
enum rst_reason {
58-
REASON_DEFAULT_RST = 0, /* normal startup by power on */
59-
REASON_WDT_RST = 1, /* hardware watch dog reset */
60-
REASON_EXCEPTION_RST = 2, /* exception reset, GPIO status won’t change */
61-
REASON_SOFT_WDT_RST = 3, /* software watch dog reset, GPIO status won’t change */
62-
REASON_SOFT_RESTART = 4, /* software restart ,system_restart , GPIO status won’t change */
63-
REASON_DEEP_SLEEP_AWAKE = 5, /* wake up from deep-sleep */
64-
REASON_EXT_SYS_RST = 6 /* external system reset */
65-
};
66-
67-
struct rst_info{
68-
uint32 reason;
69-
uint32 exccause;
70-
uint32 epc1;
71-
uint32 epc2;
72-
uint32 epc3;
73-
uint32 excvaddr;
74-
uint32 depc;
75-
};
76-
77-
struct rst_info* system_get_rst_info(void);
57+
#include "rst_info.h"
7858

7959
#define UPGRADE_FW_BIN1 0x00
8060
#define UPGRADE_FW_BIN2 0x01

0 commit comments

Comments
 (0)