mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
Mostly costmetic changes from review of last PR
This commit is contained in:
@@ -83,9 +83,8 @@
|
|||||||
|
|
||||||
enum bbsramdf_e
|
enum bbsramdf_e
|
||||||
{
|
{
|
||||||
BBSRAM_CRC_VALID = 1, /* The crc is valid */
|
BBSRAM_CRC_VALID = 1, /* The crc is valid */
|
||||||
BBSRAM_DIRTY = 2, /* The file was closed */
|
BBSRAM_DIRTY = 2, /* The file was closed */
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct bbsramd_s
|
struct bbsramd_s
|
||||||
|
|||||||
@@ -168,6 +168,7 @@ static struct stm32_bbsram_s g_bbsram[CONFIG_STM32F7_BBSRAM_FILES];
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Functions
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: stm32_bbsram_rd
|
* Name: stm32_bbsram_rd
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -199,16 +200,16 @@ static void stm32_bbsram_dump(FAR struct bbsramfh_s *bbf, char *op)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Name: stm32_bbsram_semgive
|
* Name: stm32_bbsram_semgive
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static void stm32_bbsram_semgive(FAR struct stm32_bbsram_s *priv)
|
static void stm32_bbsram_semgive(FAR struct stm32_bbsram_s *priv)
|
||||||
{
|
{
|
||||||
sem_post(&priv->exclsem);
|
sem_post(&priv->exclsem);
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Name: stm32_bbsram_semtake
|
* Name: stm32_bbsram_semtake
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -504,8 +505,8 @@ static ssize_t stm32_bbsram_internal_write(FAR struct bbsramfh_s *bbf,
|
|||||||
* Name: stm32_bbsram_write
|
* Name: stm32_bbsram_write
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static ssize_t stm32_bbsram_write(FAR struct file *filep, FAR const char *buffer,
|
static ssize_t stm32_bbsram_write(FAR struct file *filep,
|
||||||
size_t len)
|
FAR const char *buffer, size_t len)
|
||||||
{
|
{
|
||||||
FAR struct inode *inode = filep->f_inode;
|
FAR struct inode *inode = filep->f_inode;
|
||||||
FAR struct stm32_bbsram_s *bbr;
|
FAR struct stm32_bbsram_s *bbr;
|
||||||
|
|||||||
@@ -83,9 +83,8 @@
|
|||||||
|
|
||||||
enum bbsramdf_e
|
enum bbsramdf_e
|
||||||
{
|
{
|
||||||
BBSRAM_CRC_VALID = 1, /* The crc is valid */
|
BBSRAM_CRC_VALID = 1, /* The crc is valid */
|
||||||
BBSRAM_DIRTY = 2, /* The file was closed */
|
BBSRAM_DIRTY = 2, /* The file was closed */
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct bbsramd_s
|
struct bbsramd_s
|
||||||
|
|||||||
@@ -45,20 +45,4 @@
|
|||||||
|
|
||||||
#include "chip/stm32_dbgmcu.h"
|
#include "chip/stm32_dbgmcu.h"
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Pre-processor Definitions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Public Types
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Public Data
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Public Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#endif /* __ARCH_ARM_SRC_STM32F7_STM32_DBGMCU_H */
|
#endif /* __ARCH_ARM_SRC_STM32F7_STM32_DBGMCU_H */
|
||||||
|
|||||||
@@ -106,13 +106,14 @@
|
|||||||
|
|
||||||
/* The sizes of the files to create (-1) use rest of BBSRAM memory */
|
/* The sizes of the files to create (-1) use rest of BBSRAM memory */
|
||||||
|
|
||||||
#define BSRAM_FILE_SIZES { \
|
#define BSRAM_FILE_SIZES \
|
||||||
BBSRAM_SIZE_FN0, \
|
{ \
|
||||||
BBSRAM_SIZE_FN1, \
|
BBSRAM_SIZE_FN0, \
|
||||||
BBSRAM_SIZE_FN2, \
|
BBSRAM_SIZE_FN1, \
|
||||||
BBSRAM_SIZE_FN3, \
|
BBSRAM_SIZE_FN2, \
|
||||||
0 \
|
BBSRAM_SIZE_FN3, \
|
||||||
}
|
0 \
|
||||||
|
}
|
||||||
|
|
||||||
#define ARRAYSIZE(a) (sizeof((a))/sizeof(a[0]))
|
#define ARRAYSIZE(a) (sizeof((a))/sizeof(a[0]))
|
||||||
|
|
||||||
@@ -364,16 +365,20 @@ int stm32_bbsram_int(void)
|
|||||||
{
|
{
|
||||||
printf("There is a hard fault logged.\n");
|
printf("There is a hard fault logged.\n");
|
||||||
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)
|
||||||
{
|
{
|
||||||
time_sec = desc.lastwrite.tv_sec + (desc.lastwrite.tv_nsec / 1e9);
|
time_sec = desc.lastwrite.tv_sec + (desc.lastwrite.tv_nsec / 1e9);
|
||||||
gmtime_r(&time_sec, &tt);
|
gmtime_r(&time_sec, &tt);
|
||||||
strftime(buf, HEADER_TIME_FMT_LEN , HEADER_TIME_FMT , &tt);
|
strftime(buf, HEADER_TIME_FMT_LEN , HEADER_TIME_FMT , &tt);
|
||||||
|
|
||||||
syslog(LOG_INFO, "Fault Logged on %s - Valid\n", buf);
|
syslog(LOG_INFO, "Fault Logged on %s - Valid\n", buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
close(rv);
|
close(rv);
|
||||||
rv = unlink(HARDFAULT_PATH);
|
rv = unlink(HARDFAULT_PATH);
|
||||||
if (rv < 0)
|
if (rv < 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user