diff --git a/PSNee/MCU.h b/PSNee/MCU.h index f637433..4774e28 100644 --- a/PSNee/MCU.h +++ b/PSNee/MCU.h @@ -227,28 +227,26 @@ #ifdef ATmega328_168 static inline void optimizePeripherals(void) { - // Configuring Port C (A0-A5) as Digital Inputs - // DDRC at 0 = Input. Ensure that the first 6 bits are 0. - DDRC &= ~0x3F; + // --- Port C & Digital Input Configuration (A0-A5) --- + // 1. Set Port C as inputs (DDRC bits 0-5 to 0) + DDRC &= ~((1<= HYSTERESIS_MAX) { - performInjectionSequence(INJECT_SCEx); - } - -#if defined(PSNEE_DEBUG_SERIAL_MONITOR) - Debug_Inject(); -#endif + // Execute selected logic through function pointer + currentLogic(isDataSector); + if (hysteresis >= HYSTERESIS_MAX) { + performInjectionSequence(INJECT_SCEx); + } } } diff --git a/PSNee/settings.h b/PSNee/settings.h index f136820..b792403 100644 --- a/PSNee/settings.h +++ b/PSNee/settings.h @@ -144,13 +144,13 @@ #if defined(PSNEE_DEBUG_SERIAL_MONITOR) -void Debug_Log (uint16_t Lows, int Wfck_mode){ //Information about the MCU, and old or late console mode. +void Debug_Log (int Wfck_mode){ //Information about the MCU, and old or late console mode. #if defined(ATtiny85_45_25) mySerial.print("m "); mySerial.println(Wfck_mode); #elif !defined(ATtiny85_45_25) Serial.print(" MCU frequency: "); Serial.print(F_CPU); Serial.println(" Hz"); - Serial.print(" lows: "); Serial.println(Lows); + //Serial.print(" lows: "); Serial.println(Lows); Serial.print(" wfck_mode: "); Serial.println(Wfck_mode); Serial.print(" region: "); Serial.print(region[0]); Serial.print(region[1]); Serial.println(region[2]); #endif