Output clock signal during self test

This commit is contained in:
sanni 2024-07-31 12:42:26 +02:00
parent 324de5463b
commit dcadcde877

View File

@ -739,10 +739,7 @@ void seek_first_letter_in_database(FsFile& database, byte myLetter) {
} }
#if ( \ #if ( \
defined(ENABLE_ARC) || defined(ENABLE_FAIRCHILD) || defined(ENABLE_VECTREX) || defined(ENABLE_BALLY) || \ defined(ENABLE_ARC) || defined(ENABLE_FAIRCHILD) || defined(ENABLE_VECTREX) || defined(ENABLE_BALLY) || defined(ENABLE_PV1000) || defined(ENABLE_PYUUTA) || defined(ENABLE_RCA) || defined(ENABLE_TRS80) || defined(ENABLE_LEAP) || defined(ENABLE_LJ) || defined(ENABLE_VSMILE))
defined(ENABLE_PV1000) || defined(ENABLE_PYUUTA) || defined(ENABLE_RCA) || defined(ENABLE_TRS80) || \
defined(ENABLE_LEAP) || defined(ENABLE_LJ) || defined(ENABLE_VSMILE)\
)
// read single digit data line as byte // read single digit data line as byte
void readDataLineSingleDigit(FsFile& database, void* byteData) { void readDataLineSingleDigit(FsFile& database, void* byteData) {
// Read rom size // Read rom size
@ -754,9 +751,7 @@ void readDataLineSingleDigit(FsFile& database, void* byteData) {
#endif #endif
#if ( \ #if ( \
defined(ENABLE_ODY2) || defined(ENABLE_5200) || defined(ENABLE_7800) || defined(ENABLE_C64) || \ defined(ENABLE_ODY2) || defined(ENABLE_5200) || defined(ENABLE_7800) || defined(ENABLE_C64) || defined(ENABLE_VIC20) || defined(ENABLE_ATARI8))
defined(ENABLE_VIC20)|| defined(ENABLE_ATARI8)\
)
struct database_entry_mapper_size { struct database_entry_mapper_size {
byte gameMapper; byte gameMapper;
byte gameSize; byte gameSize;
@ -887,13 +882,7 @@ boolean checkCartSelection(FsFile& database, void (*readData)(FsFile&, void*), v
} }
#if ( \ #if ( \
defined(ENABLE_ODY2) || defined(ENABLE_ARC) || defined(ENABLE_FAIRCHILD) || defined(ENABLE_MSX) || \ defined(ENABLE_ODY2) || defined(ENABLE_ARC) || defined(ENABLE_FAIRCHILD) || defined(ENABLE_MSX) || defined(ENABLE_POKE) || defined(ENABLE_2600) || defined(ENABLE_5200) || defined(ENABLE_7800) || defined(ENABLE_C64) || defined(ENABLE_VECTREX) || defined(ENABLE_NES) || defined(ENABLE_GBX) || defined(ENABLE_BALLY) || defined(ENABLE_PV1000) || defined(ENABLE_PYUUTA) || defined(ENABLE_RCA) || defined(ENABLE_TRS80) || defined(ENABLE_VIC20) || defined(ENABLE_LEAP) || defined(ENABLE_LJ) || defined(ENABLE_VSMILE) || defined(ENABLE_TI99) || defined(ENABLE_ATARI8))
defined(ENABLE_POKE) || defined(ENABLE_2600) || defined(ENABLE_5200) || defined(ENABLE_7800) || \
defined(ENABLE_C64) || defined(ENABLE_VECTREX) || defined(ENABLE_NES) || defined(ENABLE_GBX) || \
defined(ENABLE_BALLY) || defined(ENABLE_PV1000) || defined(ENABLE_PYUUTA) || defined(ENABLE_RCA) || \
defined(ENABLE_TRS80) || defined(ENABLE_VIC20) || defined(ENABLE_LEAP) || defined(ENABLE_LJ) || \
defined(ENABLE_VSMILE)|| defined(ENABLE_TI99) || defined(ENABLE_ATARI8)\
)
void printInstructions() { void printInstructions() {
println_Msg(FS(FSTRING_EMPTY)); println_Msg(FS(FSTRING_EMPTY));
@ -1040,8 +1029,7 @@ byte starting_letter() {
selection--; selection--;
} }
starting_letter__subDraw(selection, line); starting_letter__subDraw(selection, line);
} } else if (b == 1) { // Next
else if (b == 1) { // Next
if ((selection == 6) && (line < 3)) { if ((selection == 6) && (line < 3)) {
line++; line++;
selection = 0; selection = 0;
@ -1052,8 +1040,7 @@ byte starting_letter() {
selection++; selection++;
} }
starting_letter__subDraw(selection, line); starting_letter__subDraw(selection, line);
} } else if (b == 3) { // Long Press - Execute
else if (b == 3) { // Long Press - Execute
if ((selection + line * 7) != 27) { if ((selection + line * 7) != 27) {
display_Clear(); display_Clear();
println_Msg(F("Please wait...")); println_Msg(F("Please wait..."));
@ -1605,24 +1592,18 @@ void selfTest() {
println_Msg(F("Self Test")); println_Msg(F("Self Test"));
println_Msg(FS(FSTRING_EMPTY)); println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("Remove all Cartridges")); println_Msg(F("Remove all Cartridges"));
println_Msg(F("before continuing!!!")); println_Msg(F("before continuing!"));
#if (defined(HW3) || defined(HW2))
println_Msg(F("And turn the EEP switch on."));
#else
println_Msg(FS(FSTRING_EMPTY)); println_Msg(FS(FSTRING_EMPTY));
print_STR(press_button_STR, 1);
display_Update();
wait();
display_Clear();
#if defined(HW3)
println_Msg(F("Self Test"));
println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("Turn the EEP switch on."));
println_Msg(FS(FSTRING_EMPTY));
println_Msg(FS(FSTRING_EMPTY));
print_STR(press_button_STR, 1);
display_Update();
wait();
display_Clear();
#endif #endif
println_Msg(FS(FSTRING_EMPTY));
println_Msg(FS(FSTRING_EMPTY));
print_STR(press_button_STR, 1);
display_Update();
wait();
display_Clear();
// Test if pin 7 is held high by 1K resistor // Test if pin 7 is held high by 1K resistor
pinMode(7, INPUT); pinMode(7, INPUT);
@ -1636,8 +1617,8 @@ void selfTest() {
println_Msg(FS(FSTRING_EMPTY)); println_Msg(FS(FSTRING_EMPTY));
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
//wait(); wait();
//resetArduino(); resetArduino();
} }
println_Msg(F("Testing short to GND")); println_Msg(F("Testing short to GND"));
@ -1727,8 +1708,22 @@ void selfTest() {
display_Update(); display_Update();
wait(); wait();
resetArduino(); resetArduino();
} else {
//clockgen.set_correction(cal_factor, SI5351_PLL_INPUT_XO);
clockgen.set_pll(SI5351_PLL_FIXED, SI5351_PLLA);
clockgen.set_pll(SI5351_PLL_FIXED, SI5351_PLLB);
//clockgen.pll_reset(SI5351_PLLA);
//clockgen.pll_reset(SI5351_PLLB);
clockgen.set_freq(400000000ULL, SI5351_CLK0);
clockgen.set_freq(100000000ULL, SI5351_CLK1);
clockgen.set_freq(307200000ULL, SI5351_CLK2);
clockgen.output_enable(SI5351_CLK1, 1);
clockgen.output_enable(SI5351_CLK2, 1);
clockgen.output_enable(SI5351_CLK0, 1);
} }
println_Msg(FS(FSTRING_EMPTY));
println_Msg(F("All tests passed."));
println_Msg(FS(FSTRING_EMPTY)); println_Msg(FS(FSTRING_EMPTY));
print_STR(press_button_STR, 1); print_STR(press_button_STR, 1);
display_Update(); display_Update();
@ -3106,13 +3101,10 @@ void checkUpdater() {
if (ClockedSerial.available() > 0) { if (ClockedSerial.available() > 0) {
String cmd = ClockedSerial.readStringUntil('\n'); String cmd = ClockedSerial.readStringUntil('\n');
cmd.trim(); cmd.trim();
if (cmd == "VERCHK") if (cmd == "VERCHK") { // VERCHK: Gets OSCR version and features
{ // VERCHK: Gets OSCR version and features
delay(500); delay(500);
printVersionToSerial(); printVersionToSerial();
} } else if (cmd == "GETCLOCK") { // GETCLOCK: Gets the MEGA's current clock speed.
else if (cmd == "GETCLOCK")
{ // GETCLOCK: Gets the MEGA's current clock speed.
#if defined(ENABLE_3V3FIX) #if defined(ENABLE_3V3FIX)
ClockedSerial.print(F("Clock is running at ")); ClockedSerial.print(F("Clock is running at "));
ClockedSerial.print((clock == CS_16MHZ) ? 16UL : 8UL); ClockedSerial.print((clock == CS_16MHZ) ? 16UL : 8UL);
@ -3120,9 +3112,7 @@ void checkUpdater() {
#else /* !ENABLE_3V3FIX */ #else /* !ENABLE_3V3FIX */
ClockedSerial.println(FS(FSTRING_MODULE_NOT_ENABLED)); ClockedSerial.println(FS(FSTRING_MODULE_NOT_ENABLED));
#endif /* ENABLE_3V3FIX */ #endif /* ENABLE_3V3FIX */
} } else if (cmd.substring(1, 8) == "ETVOLTS") { // (G/S)ETVOLTS: Get and set the voltage.
else if (cmd.substring(1, 8) == "ETVOLTS")
{ // (G/S)ETVOLTS: Get and set the voltage.
#if defined(ENABLE_VSELECT) #if defined(ENABLE_VSELECT)
if (cmd != "GETVOLTS") { if (cmd != "GETVOLTS") {
switch (cmd.substring(9, 10).toInt()) { switch (cmd.substring(9, 10).toInt()) {
@ -3138,8 +3128,7 @@ void checkUpdater() {
#endif /* ENABLE_VSELECT */ #endif /* ENABLE_VSELECT */
} }
// RTC commands // RTC commands
else if (cmd.substring(1, 7) == "ETTIME") else if (cmd.substring(1, 7) == "ETTIME") { // (G/S)ETTIME: Get and set the date/time.
{ // (G/S)ETTIME: Get and set the date/time.
#if defined(ENABLE_RTC) #if defined(ENABLE_RTC)
if (cmd != "GETTIME") { if (cmd != "GETTIME") {
ClockedSerial.println(F("Setting Time...")); ClockedSerial.println(F("Setting Time..."));