ice40: uses verbose_level for SPIFlash instead of verbose/quiet (#555)

This commit is contained in:
Gwenhael Goavec-Merou 2025-06-03 11:26:38 +02:00
parent c6d4a8bff1
commit 32f744979c
1 changed files with 6 additions and 6 deletions

View File

@ -77,7 +77,7 @@ bool Ice40::program_cram(const uint8_t *data, uint32_t length)
/* load configuration data MSB first /* load configuration data MSB first
*/ */
ProgressBar progress("Loading to CRAM", length, 50, _verbose); ProgressBar progress("Loading to CRAM", length, 50, _quiet);
const uint8_t *ptr = data; const uint8_t *ptr = data;
int size = 0; int size = 0;
for (uint32_t addr = 0; addr < length; addr += size, ptr+=size) { for (uint32_t addr = 0; addr < length; addr += size, ptr+=size) {
@ -139,7 +139,7 @@ void Ice40::program(unsigned int offset, bool unprotect_flash)
_spi->gpio_clear(_rst_pin); _spi->gpio_clear(_rst_pin);
SPIFlash flash(reinterpret_cast<SPIInterface *>(_spi), unprotect_flash, SPIFlash flash(reinterpret_cast<SPIInterface *>(_spi), unprotect_flash,
_quiet); _verbose_level);
printf("%02x\n", flash.read_status_reg()); printf("%02x\n", flash.read_status_reg());
flash.read_id(); flash.read_id();
@ -170,7 +170,7 @@ bool Ice40::dumpFlash(uint32_t base_addr, uint32_t len)
/* prepare SPI access */ /* prepare SPI access */
printInfo("Read Flash ", false); printInfo("Read Flash ", false);
try { try {
SPIFlash flash(reinterpret_cast<SPIInterface *>(_spi), false, _verbose); SPIFlash flash(reinterpret_cast<SPIInterface *>(_spi), false, _verbose_level);
flash.reset(); flash.reset();
flash.power_up(); flash.power_up();
flash.dump(_filename, base_addr, len); flash.dump(_filename, base_addr, len);
@ -204,7 +204,7 @@ bool Ice40::protect_flash(uint32_t len)
prepare_flash_access(); prepare_flash_access();
/* acess */ /* acess */
try { try {
SPIFlash flash(reinterpret_cast<SPIInterface *>(_spi), false, _verbose); SPIFlash flash(reinterpret_cast<SPIInterface *>(_spi), false, _verbose_level);
/* configure flash protection */ /* configure flash protection */
if (flash.enable_protection(len) == -1) if (flash.enable_protection(len) == -1)
return false; return false;
@ -224,7 +224,7 @@ bool Ice40::unprotect_flash()
prepare_flash_access(); prepare_flash_access();
/* acess */ /* acess */
try { try {
SPIFlash flash(reinterpret_cast<SPIInterface *>(_spi), false, _verbose); SPIFlash flash(reinterpret_cast<SPIInterface *>(_spi), false, _verbose_level);
/* configure flash protection */ /* configure flash protection */
if (flash.disable_protection() == -1) if (flash.disable_protection() == -1)
return false; return false;
@ -244,7 +244,7 @@ bool Ice40::bulk_erase_flash()
prepare_flash_access(); prepare_flash_access();
/* acess */ /* acess */
try { try {
SPIFlash flash(reinterpret_cast<SPIInterface *>(_spi), false, _verbose); SPIFlash flash(reinterpret_cast<SPIInterface *>(_spi), false, _verbose_level);
/* bulk erase flash */ /* bulk erase flash */
if (flash.bulk_erase() == -1) if (flash.bulk_erase() == -1)
return false; return false;