mirror of
https://github.com/sanni/cartreader.git
synced 2024-11-15 01:15:06 +01:00
Add CFI option to flashrom programmer
This commit is contained in:
parent
78b53b0cb4
commit
fefd959e84
@ -4,8 +4,8 @@
|
|||||||
This project represents a community-driven effort to provide
|
This project represents a community-driven effort to provide
|
||||||
an easy to build and easy to modify cartridge dumper.
|
an easy to build and easy to modify cartridge dumper.
|
||||||
|
|
||||||
Date: 2024-03-02
|
Date: 2024-06-26
|
||||||
Version: 13.2
|
Version: 13.3
|
||||||
|
|
||||||
SD lib: https://github.com/greiman/SdFat
|
SD lib: https://github.com/greiman/SdFat
|
||||||
LCD lib: https://github.com/olikraus/u8g2
|
LCD lib: https://github.com/olikraus/u8g2
|
||||||
|
@ -31,15 +31,23 @@ static const char flashMenuItemPrint[] PROGMEM = "Print";
|
|||||||
// 8bit Flash menu items
|
// 8bit Flash menu items
|
||||||
static const char* const menuOptionsFLASH8[] PROGMEM = { flashMenuItemBlankcheck, flashMenuItemErase, flashMenuItemRead, flashMenuItemWrite, flashMenuItemID, flashMenuItemPrint, FSTRING_RESET };
|
static const char* const menuOptionsFLASH8[] PROGMEM = { flashMenuItemBlankcheck, flashMenuItemErase, flashMenuItemRead, flashMenuItemWrite, flashMenuItemID, flashMenuItemPrint, FSTRING_RESET };
|
||||||
|
|
||||||
|
#ifndef ENABLE_FLASH16
|
||||||
|
// Flash mode menu
|
||||||
|
static const char modeMenuItem1[] PROGMEM = "CFI Mode";
|
||||||
|
static const char modeMenuItem2[] PROGMEM = "Standard Mode";
|
||||||
|
static const char* const menuOptionsMode[] PROGMEM = { modeMenuItem1, modeMenuItem2, FSTRING_RESET };
|
||||||
|
#endif
|
||||||
|
|
||||||
// Misc flash strings
|
// Misc flash strings
|
||||||
const char PROGMEM ATTENTION_3_3V[] = "ATTENTION 3.3V";
|
const char PROGMEM ATTENTION_3_3V[] = "ATTENTION 3.3V";
|
||||||
|
|
||||||
#ifdef ENABLE_FLASH16
|
#ifdef ENABLE_FLASH16
|
||||||
// Flash start menu
|
// Flash start menu
|
||||||
static const char flashMenuItem1[] PROGMEM = "8bit Flash adapter";
|
static const char flashMenuItem1[] PROGMEM = "CFI";
|
||||||
static const char flashMenuItem2[] PROGMEM = "Eprom adapter";
|
static const char flashMenuItem2[] PROGMEM = "8bit Flash";
|
||||||
static const char flashMenuItem3[] PROGMEM = "16bit Flash adapter";
|
static const char flashMenuItem3[] PROGMEM = "Eprom";
|
||||||
static const char* const menuOptionsFlash[] PROGMEM = { flashMenuItem1, flashMenuItem2, flashMenuItem3, FSTRING_RESET };
|
static const char flashMenuItem4[] PROGMEM = "16bit Flash";
|
||||||
|
static const char* const menuOptionsFlash[] PROGMEM = { flashMenuItem1, flashMenuItem2, flashMenuItem3, flashMenuItem4, FSTRING_RESET };
|
||||||
|
|
||||||
// 16bit Flash menu items
|
// 16bit Flash menu items
|
||||||
static const char* const menuOptionsFLASH16[] PROGMEM = { flashMenuItemBlankcheck, flashMenuItemErase, flashMenuItemRead, flashMenuItemWrite, flashMenuItemID, flashMenuItemPrint, FSTRING_RESET };
|
static const char* const menuOptionsFLASH16[] PROGMEM = { flashMenuItemBlankcheck, flashMenuItemErase, flashMenuItemRead, flashMenuItemWrite, flashMenuItemID, flashMenuItemPrint, FSTRING_RESET };
|
||||||
@ -49,15 +57,26 @@ static const char epromMenuItem4[] PROGMEM = "Verify";
|
|||||||
static const char* const menuOptionsEprom[] PROGMEM = { flashMenuItemBlankcheck, flashMenuItemRead, flashMenuItemWrite, epromMenuItem4, flashMenuItemPrint, FSTRING_RESET };
|
static const char* const menuOptionsEprom[] PROGMEM = { flashMenuItemBlankcheck, flashMenuItemRead, flashMenuItemWrite, epromMenuItem4, flashMenuItemPrint, FSTRING_RESET };
|
||||||
|
|
||||||
void flashMenu() {
|
void flashMenu() {
|
||||||
// create menu with title and 3 options to choose from
|
// create menu with title and 5 options to choose from
|
||||||
unsigned char flashSlot;
|
unsigned char flashSlot;
|
||||||
// Copy menuOptions out of progmem
|
// Copy menuOptions out of progmem
|
||||||
convertPgm(menuOptionsFlash, 4);
|
convertPgm(menuOptionsFlash, 5);
|
||||||
flashSlot = question_box(F("Select adapter PCB"), menuOptions, 4, 0);
|
flashSlot = question_box(F("Select Mode"), menuOptions, 5, 0);
|
||||||
|
|
||||||
// wait for user choice to come back from the question box menu
|
// wait for user choice to come back from the question box menu
|
||||||
switch (flashSlot) {
|
switch (flashSlot) {
|
||||||
case 0:
|
case 0:
|
||||||
|
setupCFI();
|
||||||
|
flashSize = 8388608;
|
||||||
|
writeCFI_Flash(0);
|
||||||
|
verifyFlash();
|
||||||
|
print_STR(press_button_STR, 0);
|
||||||
|
display_Update();
|
||||||
|
wait();
|
||||||
|
resetArduino();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 1:
|
||||||
display_Clear();
|
display_Clear();
|
||||||
display_Update();
|
display_Update();
|
||||||
mapping = 1;
|
mapping = 1;
|
||||||
@ -67,14 +86,14 @@ void flashMenu() {
|
|||||||
mode = CORE_FLASH8;
|
mode = CORE_FLASH8;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 2:
|
||||||
display_Clear();
|
display_Clear();
|
||||||
display_Update();
|
display_Update();
|
||||||
setup_Eprom();
|
setup_Eprom();
|
||||||
mode = CORE_EPROM;
|
mode = CORE_EPROM;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 3:
|
||||||
display_Clear();
|
display_Clear();
|
||||||
display_Update();
|
display_Update();
|
||||||
setup_Flash16();
|
setup_Flash16();
|
||||||
@ -83,7 +102,7 @@ void flashMenu() {
|
|||||||
mode = CORE_FLASH16;
|
mode = CORE_FLASH16;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 4:
|
||||||
resetArduino();
|
resetArduino();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -96,10 +115,33 @@ void flashMenu() {
|
|||||||
display_Clear();
|
display_Clear();
|
||||||
display_Update();
|
display_Update();
|
||||||
mapping = 1;
|
mapping = 1;
|
||||||
setup_Flash8();
|
|
||||||
id_Flash8();
|
// create menu with title and 3 options to choose from
|
||||||
wait();
|
unsigned char flashMode;
|
||||||
mode = CORE_FLASH8;
|
// Copy menuOptions out of progmem
|
||||||
|
convertPgm(menuOptionsMode, 3);
|
||||||
|
flashMode = question_box(F("Select Flash Mode"), menuOptions, 3, 0);
|
||||||
|
|
||||||
|
// wait for user choice to come back from the question box menu
|
||||||
|
switch (flashMode) {
|
||||||
|
case 0:
|
||||||
|
setupCFI();
|
||||||
|
flashSize = 8388608;
|
||||||
|
writeCFI_Flash(0);
|
||||||
|
verifyFlash();
|
||||||
|
print_STR(press_button_STR, 0);
|
||||||
|
display_Update();
|
||||||
|
wait();
|
||||||
|
resetArduino();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
setup_Flash8();
|
||||||
|
id_Flash8();
|
||||||
|
wait();
|
||||||
|
mode = CORE_FLASH8;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
* String Constants
|
* String Constants
|
||||||
**/
|
**/
|
||||||
// Firmware Version
|
// Firmware Version
|
||||||
constexpr char PROGMEM FSTRING_VERSION[] = "V13.2";
|
constexpr char PROGMEM FSTRING_VERSION[] = "V13.3";
|
||||||
|
|
||||||
// Universal
|
// Universal
|
||||||
constexpr char PROGMEM FSTRING_RESET[] = "Reset";
|
constexpr char PROGMEM FSTRING_RESET[] = "Reset";
|
||||||
|
Loading…
Reference in New Issue
Block a user