don't allow bank changes for 512mb flash

This commit is contained in:
Matthew Berry 2021-01-23 19:35:50 -08:00
parent 0a9b5afcb0
commit d4068da188

View file

@ -69,7 +69,7 @@ class Flash < Storage
@state ^= State::PREPARE_ERASE @state ^= State::PREPARE_ERASE
end end
when Command::PREPARE_WRITE.value then @state |= State::PREPARE_WRITE when Command::PREPARE_WRITE.value then @state |= State::PREPARE_WRITE
when Command::SET_BANK.value then @state |= State::SET_BANK when Command::SET_BANK.value then @state |= State::SET_BANK if @type == Type::FLASH1M
else puts "Unsupported flash command #{hex_str value}" else puts "Unsupported flash command #{hex_str value}"
end end
elsif @state.includes?(State::PREPARE_ERASE) && index & 0x0FFF == 0 && value == Command::ERASE_CHUNK.value elsif @state.includes?(State::PREPARE_ERASE) && index & 0x0FFF == 0 && value == Command::ERASE_CHUNK.value