Mostly costmetic changes from review of last PR

This commit is contained in:
Gregory Nutt
2016-06-29 07:33:30 -06:00
parent f82fafaa2b
commit 6aa067e929
5 changed files with 22 additions and 34 deletions
+2 -3
View File
@@ -83,9 +83,8 @@
enum bbsramdf_e
{
BBSRAM_CRC_VALID = 1, /* The crc is valid */
BBSRAM_DIRTY = 2, /* The file was closed */
BBSRAM_CRC_VALID = 1, /* The crc is valid */
BBSRAM_DIRTY = 2, /* The file was closed */
};
struct bbsramd_s
+6 -5
View File
@@ -168,6 +168,7 @@ static struct stm32_bbsram_s g_bbsram[CONFIG_STM32F7_BBSRAM_FILES];
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Name: stm32_bbsram_rd
****************************************************************************/
@@ -199,16 +200,16 @@ static void stm32_bbsram_dump(FAR struct bbsramfh_s *bbf, char *op)
}
#endif
/************************************************************************************
/****************************************************************************
* Name: stm32_bbsram_semgive
************************************************************************************/
****************************************************************************/
static void stm32_bbsram_semgive(FAR struct stm32_bbsram_s *priv)
{
sem_post(&priv->exclsem);
}
/************************************************************************************
/****************************************************************************
* Name: stm32_bbsram_semtake
*
* Description:
@@ -504,8 +505,8 @@ static ssize_t stm32_bbsram_internal_write(FAR struct bbsramfh_s *bbf,
* Name: stm32_bbsram_write
****************************************************************************/
static ssize_t stm32_bbsram_write(FAR struct file *filep, FAR const char *buffer,
size_t len)
static ssize_t stm32_bbsram_write(FAR struct file *filep,
FAR const char *buffer, size_t len)
{
FAR struct inode *inode = filep->f_inode;
FAR struct stm32_bbsram_s *bbr;
+2 -3
View File
@@ -83,9 +83,8 @@
enum bbsramdf_e
{
BBSRAM_CRC_VALID = 1, /* The crc is valid */
BBSRAM_DIRTY = 2, /* The file was closed */
BBSRAM_CRC_VALID = 1, /* The crc is valid */
BBSRAM_DIRTY = 2, /* The file was closed */
};
struct bbsramd_s
-16
View File
@@ -45,20 +45,4 @@
#include "chip/stm32_dbgmcu.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Public Types
****************************************************************************/
/****************************************************************************
* Public Data
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
#endif /* __ARCH_ARM_SRC_STM32F7_STM32_DBGMCU_H */
+12 -7
View File
@@ -106,13 +106,14 @@
/* The sizes of the files to create (-1) use rest of BBSRAM memory */
#define BSRAM_FILE_SIZES { \
BBSRAM_SIZE_FN0, \
BBSRAM_SIZE_FN1, \
BBSRAM_SIZE_FN2, \
BBSRAM_SIZE_FN3, \
0 \
}
#define BSRAM_FILE_SIZES \
{ \
BBSRAM_SIZE_FN0, \
BBSRAM_SIZE_FN1, \
BBSRAM_SIZE_FN2, \
BBSRAM_SIZE_FN3, \
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");
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 "
"state:%d\n",(unsigned int)desc.fileno, (unsigned int) desc.len,
(unsigned int)desc.flags, state);
if (state == OK)
{
time_sec = desc.lastwrite.tv_sec + (desc.lastwrite.tv_nsec / 1e9);
gmtime_r(&time_sec, &tt);
strftime(buf, HEADER_TIME_FMT_LEN , HEADER_TIME_FMT , &tt);
syslog(LOG_INFO, "Fault Logged on %s - Valid\n", buf);
}
close(rv);
rv = unlink(HARDFAULT_PATH);
if (rv < 0)