diff options
author | sanni <[email protected]> | 2021-11-18 14:55:50 +0100 |
---|---|---|
committer | sanni <[email protected]> | 2021-11-18 14:55:50 +0100 |
commit | eef1c6e8cc5e7a81c69e6a52acb2e6b94337d938 (patch) | |
tree | 83ed48fed1bcb8fa3d6d809d6c3c1d146dd25770 /Cart_Reader/N64.ino | |
parent | ed3663a21fdb738f1c500888a876513c683f3095 (diff) | |
download | cartreader-eef1c6e8cc5e7a81c69e6a52acb2e6b94337d938.tar.gz cartreader-eef1c6e8cc5e7a81c69e6a52acb2e6b94337d938.zip |
Add check if Clockgen is working
Diffstat (limited to 'Cart_Reader/N64.ino')
-rw-r--r-- | Cart_Reader/N64.ino | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Cart_Reader/N64.ino b/Cart_Reader/N64.ino index 21f8a59..8d56047 100644 --- a/Cart_Reader/N64.ino +++ b/Cart_Reader/N64.ino @@ -431,15 +431,20 @@ void setup_N64_Cart() { #ifdef clockgen_calibration
int32_t clock_offset = readClockOffset();
if (clock_offset > INT32_MIN) {
- clockgen.init(SI5351_CRYSTAL_LOAD_8PF, 0, clock_offset);
+ i2c_found = clockgen.init(SI5351_CRYSTAL_LOAD_8PF, 0, clock_offset);
} else {
- clockgen.init(SI5351_CRYSTAL_LOAD_8PF, 0, 0);
+ i2c_found = clockgen.init(SI5351_CRYSTAL_LOAD_8PF, 0, 0);
}
#else
// last number is the clock correction factor which is custom for each clock generator
- clockgen.init(SI5351_CRYSTAL_LOAD_8PF, 0, 0);
+ i2c_found = clockgen.init(SI5351_CRYSTAL_LOAD_8PF, 0, 0);
#endif
+ if (!i2c_found) {
+ display_Clear();
+ print_Error(F("Clock Generator not found"), true);
+ }
+
// Set Eeprom clock to 2Mhz
clockgen.set_freq(200000000ULL, SI5351_CLK1);
@@ -3549,7 +3554,7 @@ redumpsamefolder: myFile.close();
unsigned long timeElapsed = (millis() - startTime) / 1000; // seconds
-
+
print_Msg(F("CRC: "));
// convert checksum to string
char crcStr[9];
|