-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
spiFlash: Fixed a bug where the sector erase instruction was being ru…
…n without the opcode being passed along
- Loading branch information
Showing
2 changed files
with
6 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
// SPDX-FileCopyrightText: 2023 1BitSquared <[email protected]> | ||
// SPDX-FileContributor: Written by Rachel Mant <[email protected]> | ||
#include <cstdint> | ||
#include <string_view> | ||
#include <substrate/console> | ||
#include <substrate/index_sequence> | ||
|
@@ -33,7 +34,7 @@ namespace bmpflash::spiFlash | |
console.debug("Erasing sector at 0x"sv, asHex_t<6, '0'>{address}); | ||
// Start by erasing the block | ||
if (!probe.runCommand(spiFlashCommand_t::writeEnable, 0U) || | ||
!probe.runCommand(spiFlashCommand_t::sectorErase, static_cast<uint32_t>(address)) || | ||
!probe.runCommand(spiFlashCommand_t::sectorErase | sectorEraseOpcode_, static_cast<uint32_t>(address)) || | ||
!waitFlashIdle(probe)) | ||
{ | ||
console.error("Failed to prepare SPI Flash block for writing"sv); | ||
|