commit d119df204a8a049ecfa1a4484889c1f36bb2abb0
parent f0fb55dbf4241f859e5dffc1f35c8454c6ff3878
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date: Wed, 24 Jul 2024 09:20:21 +0200
fill presets flash with $ff if the file cannot be found
Diffstat:
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/source/nord/n2x/n2xLib/n2xi2cflash.cpp b/source/nord/n2x/n2xLib/n2xi2cflash.cpp
@@ -6,6 +6,14 @@
namespace n2x
{
+ template<> RomData<g_flashSize>::RomData();
+
+ I2cFlash::I2cFlash()
+ {
+ if(!isValid())
+ data().fill(0xff);
+ }
+
void I2cFlash::onStartCondition()
{
m_state = State::ReadDeviceSelect;
diff --git a/source/nord/n2x/n2xLib/n2xi2cflash.h b/source/nord/n2x/n2xLib/n2xi2cflash.h
@@ -10,6 +10,10 @@ namespace n2x
{
class I2cFlash : public I2c, public RomData<g_flashSize>
{
+ public:
+ I2cFlash();
+
+ private:
enum class State
{
ReadDeviceSelect, AckDeviceSelect,
@@ -33,7 +37,6 @@ namespace n2x
Write = 0b0000'000'0,
};
- protected:
void onStartCondition() override;
void onStopCondition() override;
void onByteWritten() override;