Add crude remember-last-menu-item feature to firmware
@@ -46,6 +46,10 @@ void FlashLoader::Init()
// register LS
g_commandStream.AddCommandHandler(CDCCommandHandler::CDCFourCCMake<'_', '_', 'L', 'S'>::value, this);
+
+ uint32_t* p = (uint32_t *)0x3800fff8;
+
+ m_uCurrentFile = p[0];
}
@@ -72,6 +76,10 @@ void FlashLoader::FSInit(void)
fr = f_findnext(&dj, &fno);
}
+ if(m_uCurrentFile > m_uFileCount) {
+ m_uCurrentFile = m_uFileCount;
+ }
+
f_closedir(&dj);
m_bFsInit = true;
@@ -270,6 +278,10 @@ void FlashLoader::RenderFlashFile(uint32_t time)
blit::switch_execution();
}
}
+
+ *((uint32_t *)0x3800fff8) = m_uCurrentFile;
+
+ SCB_CleanDCache();
}
