mirror of
https://github.com/apache/nuttx.git
synced 2026-05-29 04:19:37 +08:00
nucleo-144:stm32_bbsram make coding standard compliant
This commit is contained in:
committed by
Xiang Xiao
parent
ed5d00edd8
commit
0cc3f95bb4
@@ -31,7 +31,7 @@
|
|||||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
@@ -118,7 +118,7 @@
|
|||||||
|
|
||||||
#define ARRAYSIZE(a) (sizeof((a))/sizeof(a[0]))
|
#define ARRAYSIZE(a) (sizeof((a))/sizeof(a[0]))
|
||||||
|
|
||||||
/* For Assert keep this much of the file name*/
|
/* For Assert keep this much of the file name */
|
||||||
|
|
||||||
#define MAX_FILE_PATH_LENGTH 40
|
#define MAX_FILE_PATH_LENGTH 40
|
||||||
|
|
||||||
@@ -142,7 +142,6 @@ typedef struct
|
|||||||
uint32_t sp;
|
uint32_t sp;
|
||||||
uint32_t top;
|
uint32_t top;
|
||||||
uint32_t size;
|
uint32_t size;
|
||||||
|
|
||||||
} _stack_t;
|
} _stack_t;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
@@ -264,12 +263,13 @@ typedef struct
|
|||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
info_t info; /* The info */
|
info_t info; /* The info */
|
||||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3 /* The amount of stack data is compile time
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
* sized backed on what is left after the
|
/* The amount of stack data is compile time
|
||||||
* other BBSRAM files are defined
|
* sized backed on what is left after the
|
||||||
* The order is such that only the
|
* other BBSRAM files are defined
|
||||||
* ustack should be truncated
|
* The order is such that only the
|
||||||
*/
|
* ustack should be truncated
|
||||||
|
*/
|
||||||
stack_word_t istack[CONFIG_USTACK_SIZE];
|
stack_word_t istack[CONFIG_USTACK_SIZE];
|
||||||
#endif
|
#endif
|
||||||
stack_word_t ustack[CONFIG_ISTACK_SIZE];
|
stack_word_t ustack[CONFIG_ISTACK_SIZE];
|
||||||
@@ -308,8 +308,8 @@ static int hardfault_get_desc(struct bbsramd_s *desc)
|
|||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
syslog(LOG_INFO, "stm32 bbsram: Failed to get Fault Log descriptor "
|
syslog(LOG_INFO, "stm32 bbsram: Failed to get Fault Log "
|
||||||
"(%d)\n", ret);
|
"descriptor (%d)\n", ret);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -354,6 +354,7 @@ int stm32_bbsram_int(void)
|
|||||||
|
|
||||||
#if defined(CONFIG_STM32F7_SAVE_CRASHDUMP)
|
#if defined(CONFIG_STM32F7_SAVE_CRASHDUMP)
|
||||||
/* Panic Logging in Battery Backed Up Files */
|
/* Panic Logging in Battery Backed Up Files */
|
||||||
|
|
||||||
/* Do we have an hard fault in BBSRAM? */
|
/* Do we have an hard fault in BBSRAM? */
|
||||||
|
|
||||||
rv = hardfault_get_desc(&desc);
|
rv = hardfault_get_desc(&desc);
|
||||||
@@ -363,7 +364,7 @@ int stm32_bbsram_int(void)
|
|||||||
state = (desc.lastwrite.tv_sec || desc.lastwrite.tv_nsec) ? OK : 1;
|
state = (desc.lastwrite.tv_sec || desc.lastwrite.tv_nsec) ? OK : 1;
|
||||||
|
|
||||||
syslog(LOG_INFO, "Fault Log info File No %d Length %d flags:0x%02x "
|
syslog(LOG_INFO, "Fault Log info File No %d Length %d flags:0x%02x "
|
||||||
"state:%d\n",(unsigned int)desc.fileno, (unsigned int) desc.len,
|
"state:%d\n", (unsigned int)desc.fileno, (unsigned int) desc.len,
|
||||||
(unsigned int)desc.flags, state);
|
(unsigned int)desc.flags, state);
|
||||||
|
|
||||||
if (state == OK)
|
if (state == OK)
|
||||||
@@ -378,8 +379,8 @@ int stm32_bbsram_int(void)
|
|||||||
rv = unlink(HARDFAULT_PATH);
|
rv = unlink(HARDFAULT_PATH);
|
||||||
if (rv < 0)
|
if (rv < 0)
|
||||||
{
|
{
|
||||||
syslog(LOG_INFO, "stm32 bbsram: Failed to unlink Fault Log file [%s"
|
syslog(LOG_INFO, "stm32 bbsram: Failed to unlink Fault Log file "
|
||||||
"] (%d)\n", HARDFAULT_PATH, rv);
|
"[%s] (%d)\n", HARDFAULT_PATH, rv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_STM32F7_SAVE_CRASHDUMP */
|
#endif /* CONFIG_STM32F7_SAVE_CRASHDUMP */
|
||||||
@@ -493,7 +494,8 @@ void board_crashdump(uintptr_t currentsp, FAR void *tcb,
|
|||||||
|
|
||||||
/* Is it Invalid? */
|
/* Is it Invalid? */
|
||||||
|
|
||||||
if (!(pdump->info.stacks.interrupt.sp <= pdump->info.stacks.interrupt.top &&
|
if (!(pdump->info.stacks.interrupt.sp <=
|
||||||
|
pdump->info.stacks.interrupt.top &&
|
||||||
pdump->info.stacks.interrupt.sp > pdump->info.stacks.interrupt.top -
|
pdump->info.stacks.interrupt.sp > pdump->info.stacks.interrupt.top -
|
||||||
pdump->info.stacks.interrupt.size))
|
pdump->info.stacks.interrupt.size))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user