Fix error in flashrom programmer menu

This commit is contained in:
sanni 2023-04-20 11:38:46 +02:00
parent c851a3c011
commit 0a21d49f8a
2 changed files with 32 additions and 37 deletions

View File

@ -1028,11 +1028,7 @@ void mainMenu() {
#ifdef enable_FLASH #ifdef enable_FLASH
case 19: case 19:
#ifdef enable_FLASH16
flashMenu(); flashMenu();
#else
flashromMenu8();
#endif
break; break;
#endif #endif
@ -1195,11 +1191,7 @@ void addonMenu() {
#ifdef enable_FLASH #ifdef enable_FLASH
case 4: case 4:
#ifdef enable_FLASH16
flashMenu(); flashMenu();
#else
flashromMenu8();
#endif
break; break;
#endif #endif
@ -2013,11 +2005,11 @@ void setup() {
#endif #endif
#ifdef enable_neopixel #ifdef enable_neopixel
#if defined(ENABLE_3V3FIX) #if defined(ENABLE_3V3FIX)
// Set power high for neopixel // Set power high for neopixel
setVoltage(VOLTS_SET_5V); setVoltage(VOLTS_SET_5V);
delay(10); delay(10);
#endif #endif
pixels.begin(); pixels.begin();
pixels.clear(); pixels.clear();
pixels.setPixelColor(0, pixels.Color(background_color)); pixels.setPixelColor(0, pixels.Color(background_color));
@ -2025,27 +2017,27 @@ void setup() {
pixels.setPixelColor(2, pixels.Color(0, 0, 100)); pixels.setPixelColor(2, pixels.Color(0, 0, 100));
pixels.show(); pixels.show();
// Set TX0 LED Pin(PE1) to Output for status indication during flashing for HW4 // Set TX0 LED Pin(PE1) to Output for status indication during flashing for HW4
#if !(defined(enable_serial) || defined(HW5)) #if !(defined(enable_serial) || defined(HW5))
DDRE |= (1 << 1); DDRE |= (1 << 1);
#endif #endif
#else #else
#ifndef enable_LCD #ifndef enable_LCD
#ifdef CA_LED #ifdef CA_LED
// Turn LED off // Turn LED off
digitalWrite(12, 1); digitalWrite(12, 1);
digitalWrite(11, 1); digitalWrite(11, 1);
digitalWrite(10, 1); digitalWrite(10, 1);
#endif #endif
// Configure 4 Pin RGB LED pins as output // Configure 4 Pin RGB LED pins as output
DDRB |= (1 << DDB6); // Red LED (pin 12) DDRB |= (1 << DDB6); // Red LED (pin 12)
DDRB |= (1 << DDB5); // Green LED (pin 11) DDRB |= (1 << DDB5); // Green LED (pin 11)
DDRB |= (1 << DDB4); // Blue LED (pin 10) DDRB |= (1 << DDB4); // Blue LED (pin 10)
#endif #endif
#endif #endif
// Set power to low to protect carts // Set power to low to protect carts
setVoltage(VOLTS_SET_3V3); setVoltage(VOLTS_SET_3V3);
#ifdef enable_OLED #ifdef enable_OLED
display.begin(); display.begin();
@ -2133,9 +2125,9 @@ void dataIn() {
// Set RGB color // Set RGB color
void setColor_RGB(byte r, byte g, byte b) { void setColor_RGB(byte r, byte g, byte b) {
#if defined(enable_neopixel) #if defined(enable_neopixel)
#if defined(ENABLE_3V3FIX) #if defined(ENABLE_3V3FIX)
if (clock == CS_8MHZ) return; if (clock == CS_8MHZ) return;
#endif #endif
// Dim Neopixel LEDs // Dim Neopixel LEDs
if (r >= 100) r = 100; if (r >= 100) r = 100;
if (g >= 100) g = 100; if (g >= 100) g = 100;

View File

@ -30,7 +30,6 @@ static const char flash8MenuItem6[] PROGMEM = "Print";
//static const char flash8MenuItem7[] PROGMEM = "Reset"; (stored in common strings array) //static const char flash8MenuItem7[] PROGMEM = "Reset"; (stored in common strings array)
static const char* const menuOptionsFLASH8[] PROGMEM = { flash8MenuItem1, flash8MenuItem2, flash8MenuItem3, flash8MenuItem4, flash8MenuItem5, flash8MenuItem6, string_reset2 }; static const char* const menuOptionsFLASH8[] PROGMEM = { flash8MenuItem1, flash8MenuItem2, flash8MenuItem3, flash8MenuItem4, flash8MenuItem5, flash8MenuItem6, string_reset2 };
#ifdef enable_FLASH16
// Flash start menu // Flash start menu
static const char flashMenuItem1[] PROGMEM = "8bit Flash adapter"; static const char flashMenuItem1[] PROGMEM = "8bit Flash adapter";
static const char flashMenuItem2[] PROGMEM = "Eprom adapter"; static const char flashMenuItem2[] PROGMEM = "Eprom adapter";
@ -76,6 +75,7 @@ void flashMenu() {
mode = mode_FLASH8; mode = mode_FLASH8;
break; break;
#ifdef enable_FLASH16
case 1: case 1:
display_Clear(); display_Clear();
display_Update(); display_Update();
@ -91,13 +91,16 @@ void flashMenu() {
wait(); wait();
mode = mode_FLASH16; mode = mode_FLASH16;
break; break;
#endif
case 3: case 3:
resetArduino(); resetArduino();
break; break;
default:
print_MissingModule(); // does not return
} }
} }
#endif
void flashromMenu8() { void flashromMenu8() {
// create menu with title and 7 options to choose from // create menu with title and 7 options to choose from