Skip to content

Commit

Permalink
Fixes whitespace.
Browse files Browse the repository at this point in the history
  • Loading branch information
balazsracz committed Nov 12, 2023
1 parent 6a74c9b commit 58771f0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
6 changes: 4 additions & 2 deletions src/freertos_drivers/st/Stm32Flash.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@

#include "freertos_drivers/st/Stm32Flash.hxx"

uint32_t STM32F7_DUAL_BANK_2M_FLASH[] = {
uint32_t STM32F7_DUAL_BANK_2M_FLASH[] =
{
0x08000000,
0x08004000,
0x08008000,
Expand Down Expand Up @@ -66,7 +67,8 @@ uint32_t STM32F7_DUAL_BANK_2M_FLASH[] = {
static_assert(ARRAYSIZE(STM32F7_DUAL_BANK_2M_FLASH) == 25,
"dual bank 2M flash mismatch");

uint32_t STM32F7_SINGLE_BANK_2M_FLASH[] = {
uint32_t STM32F7_SINGLE_BANK_2M_FLASH[] =
{
0x08000000,
0x08008000,
0x08010000,
Expand Down
15 changes: 9 additions & 6 deletions src/freertos_drivers/st/Stm32Flash.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@

/// Strategy module for finding flash erase sector numbers when the sectors are
/// constant size.
template <uint32_t ERASE_PAGE_SIZE> struct FlashFixedSectors {
template <uint32_t ERASE_PAGE_SIZE> struct FlashFixedSectors
{
/// Aligns an address to the next possible sector start (i.e., rounds up to
/// sector boundary).
/// @param addr an address in the flash address space.
Expand Down Expand Up @@ -74,8 +75,9 @@ struct FlashVariableSectors
/// bank_config is an array of uint32 addresses, containing the start of
/// each sector. The sector number is the index in this array. As a
/// sentinel, the element after the last shall be 0xfffffffful.
constexpr FlashVariableSectors(uint32_t* bank_config)
: bankConfig_(bank_config) {}
constexpr FlashVariableSectors(uint32_t *bank_config)
: bankConfig_(bank_config)
{ }

/// Aligns an address to the next possible sector start (i.e., rounds up to
/// sector boundary).
Expand Down Expand Up @@ -110,14 +112,15 @@ struct FlashVariableSectors
uint32_t next = next_sector_address(addr);
return {lastIndex_ + 1, next};
}

protected:
/// 1-element cache on where to start looking for
/// sectors. bankConfig_[lastIndex_] <= last address that was queried.
unsigned lastIndex_{0};
unsigned lastIndex_ {0};

private:
/// Contains an array of the start addresses of the erase sectors.
uint32_t* bankConfig_;
uint32_t *bankConfig_;
};

extern uint32_t STM32F7_DUAL_BANK_2M_FLASH[];
Expand Down

0 comments on commit 58771f0

Please sign in to comment.