From b67644ba35ee4879d002dafef85df69000c3b83f Mon Sep 17 00:00:00 2001 From: Maxim Poliakovski Date: Thu, 11 Aug 2022 01:43:08 +0200 Subject: [PATCH] athens: support ID reading & dot clock disabling. --- devices/common/i2c/athens.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/devices/common/i2c/athens.cpp b/devices/common/i2c/athens.cpp index 2edd25d..1cc242b 100644 --- a/devices/common/i2c/athens.cpp +++ b/devices/common/i2c/athens.cpp @@ -85,8 +85,8 @@ bool AthensClocks::send_byte(uint8_t data) bool AthensClocks::receive_byte(uint8_t* p_data) { - LOG_F(INFO, "Athens: receive_byte called"); - return false; // return NACK for now + *p_data = 0x41; // return my ID (value has been guessed) + return true; } int AthensClocks::get_sys_freq() @@ -101,6 +101,11 @@ int AthensClocks::get_dot_freq() 22, 27, 28, 31, 35, 37, 38, 42, 49, 55, 56, 78, 125 }; + if (this->regs[AthensRegs::P2_MUX2] & 0xC0) { + LOG_F(INFO, "Athens: dot clock disabled"); + return 0; + } + float out_freq = 0.0f; int d2 = this->regs[AthensRegs::D2];