diff options
| author | QMK Bot <hello@qmk.fm> | 2022-02-12 10:29:31 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-12 18:29:31 +0000 |
| commit | 63646e8906e062d1c1de3925cba70c4e3426a855 (patch) | |
| tree | 4e91648b77b838e1125cf86331d7e84bde6d07a9 /drivers/flash | |
| parent | afcdd7079c774dec2aa4b7f2d08adf8b7310919b (diff) | |
Format code according to conventions (#16322)
Diffstat (limited to 'drivers/flash')
| -rw-r--r-- | drivers/flash/flash_spi.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/flash/flash_spi.c b/drivers/flash/flash_spi.c index 2fa8891e38..f4cbf65159 100644 --- a/drivers/flash/flash_spi.c +++ b/drivers/flash/flash_spi.c | |||
| @@ -65,7 +65,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 65 | 65 | ||
| 66 | // #define DEBUG_FLASH_SPI_OUTPUT | 66 | // #define DEBUG_FLASH_SPI_OUTPUT |
| 67 | 67 | ||
| 68 | static bool spi_flash_start(void) { return spi_start(EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN, EXTERNAL_FLASH_SPI_LSBFIRST, EXTERNAL_FLASH_SPI_MODE, EXTERNAL_FLASH_SPI_CLOCK_DIVISOR); } | 68 | static bool spi_flash_start(void) { |
| 69 | return spi_start(EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN, EXTERNAL_FLASH_SPI_LSBFIRST, EXTERNAL_FLASH_SPI_MODE, EXTERNAL_FLASH_SPI_CLOCK_DIVISOR); | ||
| 70 | } | ||
| 69 | 71 | ||
| 70 | static flash_status_t spi_flash_wait_while_busy(void) { | 72 | static flash_status_t spi_flash_wait_while_busy(void) { |
| 71 | uint32_t deadline = timer_read32() + EXTERNAL_FLASH_SPI_TIMEOUT; | 73 | uint32_t deadline = timer_read32() + EXTERNAL_FLASH_SPI_TIMEOUT; |
| @@ -160,7 +162,9 @@ static flash_status_t spi_flash_transaction(uint8_t cmd, uint32_t addr, uint8_t | |||
| 160 | return response; | 162 | return response; |
| 161 | } | 163 | } |
| 162 | 164 | ||
| 163 | void flash_init(void) { spi_init(); } | 165 | void flash_init(void) { |
| 166 | spi_init(); | ||
| 167 | } | ||
| 164 | 168 | ||
| 165 | flash_status_t flash_erase_chip(void) { | 169 | flash_status_t flash_erase_chip(void) { |
| 166 | flash_status_t response = FLASH_STATUS_SUCCESS; | 170 | flash_status_t response = FLASH_STATUS_SUCCESS; |
| @@ -304,7 +308,7 @@ flash_status_t flash_read_block(uint32_t addr, void *buf, size_t len) { | |||
| 304 | dprintf(" %02X", (int)(((uint8_t *)read_buf)[i])); | 308 | dprintf(" %02X", (int)(((uint8_t *)read_buf)[i])); |
| 305 | } | 309 | } |
| 306 | dprintf("\n"); | 310 | dprintf("\n"); |
| 307 | #endif // DEBUG_FLASH_SPI_OUTPUT | 311 | #endif // DEBUG_FLASH_SPI_OUTPUT |
| 308 | 312 | ||
| 309 | return response; | 313 | return response; |
| 310 | } | 314 | } |
| @@ -340,7 +344,7 @@ flash_status_t flash_write_block(uint32_t addr, const void *buf, size_t len) { | |||
| 340 | dprintf(" %02X", (int)(uint8_t)(write_buf[i])); | 344 | dprintf(" %02X", (int)(uint8_t)(write_buf[i])); |
| 341 | } | 345 | } |
| 342 | dprintf("\n"); | 346 | dprintf("\n"); |
| 343 | #endif // DEBUG_FLASH_SPI_OUTPUT | 347 | #endif // DEBUG_FLASH_SPI_OUTPUT |
| 344 | 348 | ||
| 345 | /* Perform the write. */ | 349 | /* Perform the write. */ |
| 346 | response = spi_flash_transaction(FLASH_CMD_PP, addr, write_buf, write_length); | 350 | response = spi_flash_transaction(FLASH_CMD_PP, addr, write_buf, write_length); |
