mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 14:27:37 +08:00
Minor updates from review of last PR.
This commit is contained in:
@@ -110,7 +110,6 @@
|
|||||||
|
|
||||||
/* File Header */
|
/* File Header */
|
||||||
|
|
||||||
|
|
||||||
struct bbsramfh_s
|
struct bbsramfh_s
|
||||||
{
|
{
|
||||||
uint32_t crc; /* CRC calculated over data and this struct
|
uint32_t crc; /* CRC calculated over data and this struct
|
||||||
@@ -118,14 +117,13 @@ struct bbsramfh_s
|
|||||||
union
|
union
|
||||||
{
|
{
|
||||||
uint32_t unit32; /* uint32 access to force ECC from preventing
|
uint32_t unit32; /* uint32 access to force ECC from preventing
|
||||||
commit */
|
* commit */
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
uint8_t fileno; /* The minor number */
|
uint8_t fileno; /* The minor number */
|
||||||
uint8_t dirty; /* Data has been written to the file */
|
uint8_t dirty; /* Data has been written to the file */
|
||||||
uint16_t len; /* Total Bytes in this file */
|
uint16_t len; /* Total Bytes in this file */
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct timespec lastwrite; /* Last write time */
|
struct timespec lastwrite; /* Last write time */
|
||||||
@@ -239,7 +237,7 @@ static void stm32_bbsram_semgive(FAR struct stm32_bbsram_s *priv)
|
|||||||
* Returned Value:
|
* Returned Value:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static void stm32_bbsram_semtake(FAR struct stm32_bbsram_s *priv)
|
static void stm32_bbsram_semtake(FAR struct stm32_bbsram_s *priv)
|
||||||
{
|
{
|
||||||
@@ -470,6 +468,7 @@ static off_t stm32_bbsram_seek(FAR struct file *filep, off_t offset,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
||||||
/* Return EINVAL if the whence argument is invalid */
|
/* Return EINVAL if the whence argument is invalid */
|
||||||
|
|
||||||
stm32_bbsram_semgive(bbr);
|
stm32_bbsram_semgive(bbr);
|
||||||
@@ -739,7 +738,6 @@ static int stm32_bbsram_probe(int *ent, struct stm32_bbsram_s pdev[])
|
|||||||
pf->fileno != i ||
|
pf->fileno != i ||
|
||||||
pf->crc != stm32_bbsram_crc(pf))
|
pf->crc != stm32_bbsram_crc(pf))
|
||||||
{
|
{
|
||||||
|
|
||||||
/* Not Valid so wipe the file in BBSRAM */
|
/* Not Valid so wipe the file in BBSRAM */
|
||||||
|
|
||||||
memset((uint8_t *)pf, 0, alloc);
|
memset((uint8_t *)pf, 0, alloc);
|
||||||
|
|||||||
@@ -106,6 +106,7 @@ extern "C"
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Function Prototypes
|
* Public Function Prototypes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: stm32_bbsraminitialize
|
* Function: stm32_bbsraminitialize
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -74,7 +74,8 @@ static inline void stm32_pwr_putreg(uint32_t offset, uint32_t value)
|
|||||||
putreg32(value, STM32_PWR_BASE + offset);
|
putreg32(value, STM32_PWR_BASE + offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void stm32_pwr_modifyreg(uint32_t offset, uint32_t clearbits, uint32_t setbits)
|
static inline void stm32_pwr_modifyreg(uint32_t offset, uint32_t clearbits,
|
||||||
|
uint32_t setbits)
|
||||||
{
|
{
|
||||||
modifyreg32(STM32_PWR_BASE + offset, clearbits, setbits);
|
modifyreg32(STM32_PWR_BASE + offset, clearbits, setbits);
|
||||||
}
|
}
|
||||||
@@ -183,7 +184,7 @@ void stm32_pwr_enablebkp(bool writable)
|
|||||||
stm32_pwr_putreg(STM32_PWR_CR1_OFFSET, regval);
|
stm32_pwr_putreg(STM32_PWR_CR1_OFFSET, regval);
|
||||||
|
|
||||||
wait = true;
|
wait = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
leave_critical_section(flags);
|
leave_critical_section(flags);
|
||||||
|
|
||||||
@@ -282,7 +283,6 @@ void stm32_pwr_disablepvd(void)
|
|||||||
|
|
||||||
void stm32_pwr_enablebreg(bool regon)
|
void stm32_pwr_enablebreg(bool regon)
|
||||||
{
|
{
|
||||||
|
|
||||||
irqstate_t flags;
|
irqstate_t flags;
|
||||||
uint32_t regval;
|
uint32_t regval;
|
||||||
uint32_t reg_wait = 0;
|
uint32_t reg_wait = 0;
|
||||||
|
|||||||
@@ -53,6 +53,11 @@
|
|||||||
|
|
||||||
/* Clocking *****************************************************************/
|
/* Clocking *****************************************************************/
|
||||||
|
|
||||||
|
/* The S32K118EVB is fitted with a 40MHz Crystal */
|
||||||
|
|
||||||
|
#define BOARD_XTAL_FREQUENCY 40000000
|
||||||
|
|
||||||
|
/* The S32K118 will run at 48MHz *.
|
||||||
|
|
||||||
/* LED definitions **********************************************************/
|
/* LED definitions **********************************************************/
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user