Skip to content

Commit 9ec132c

Browse files
committed
works
1 parent c6de387 commit 9ec132c

File tree

5 files changed

+10
-23
lines changed

5 files changed

+10
-23
lines changed

src/CEC/CEC.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class CEC_LogicalDevice : public CEC_Electrical
1010
CDT_TV,
1111
CDT_RECORDING_DEVICE,
1212
CDT_PLAYBACK_DEVICE,
13-
CDT_TUNER,
13+
CDT_TUNER,
1414
CDT_AUDIO_SYSTEM,
1515
CDT_OTHER, // Not a real CEC type..
1616
} CEC_DEVICE_TYPE;

src/CEC/CEC_Device.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,6 @@ void CEC_Device::OnReceive(int source, int dest, unsigned char* buffer, int coun
5252
for (int i = 0; i < count; i++)
5353
DbgPrint(":%02X", buffer[i]);
5454
DbgPrint("\n");
55-
if (!MonitorMode && dest == _logicalAddress && count == 1 && buffer[0] == 0x83) {
56-
uint8 buffer[4];
57-
buffer[0] = 0x84;
58-
buffer[1] = _physicalAddress >> 8;
59-
buffer[2] = _physicalAddress;
60-
buffer[3] = _deviceType;
61-
TransmitFrame(0xF, buffer, 4);
62-
}
6355
}
6456

6557
bool CEC_Device::LineState()

src/CEC/Common.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,6 @@ void DbgPrint(const char* fmt, ...);
3030
#define NULL 0
3131
#endif
3232

33-
/*
34-
static const uint32_t cyclesPerUS = (SystemCoreClock / 1000000ul);
35-
static inline unsigned long micros() {
36-
bool ready = false;
37-
if (!ready) {
38-
CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk;
39-
DWT->CTRL |= 1;
40-
ready = true;
41-
}
42-
return DWT->CYCCNT / cyclesPerUS; // TODO: handle wraparound
43-
}*/
4433
#else
4534

4635
#define ASSERT(x) ((void)0)

src/CEClient.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,17 @@ void CEClient::OnReceive(int source, int dest, unsigned char* buffer, int count)
7979

8080
if(_onReceiveCallback)
8181
_onReceiveCallback(source, dest, buffer, count);
82-
8382
else
8483
CEC_Device::OnReceive(source, dest, buffer, count);
84+
85+
if (!MonitorMode && dest == _logicalAddress && count == 1 && buffer[0] == 0x83) {
86+
unsigned char buffer[4];
87+
buffer[0] = 0x84;
88+
buffer[1] = _physicalAddress >> 8;
89+
buffer[2] = _physicalAddress;
90+
buffer[3] = _deviceType;
91+
TransmitFrame(0xF, buffer, 4);
92+
}
8593
}
8694

8795
// OnReady redefinition, to save the current status

src/CEClient.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ typedef void (*OnReceiveCallbackFunction)(int, int, unsigned char*, int);
99
typedef void (*OnTransmitCompleteCallbackFunction)(bool);
1010

1111
public:
12-
1312
CEClient(int physicalAddress, int inputPin, int outputPin=-1);
1413
void begin(CEC_DEVICE_TYPE type = CEC_LogicalDevice::CDT_PLAYBACK_DEVICE);
1514
bool isReady();
@@ -22,7 +21,6 @@ typedef void (*OnTransmitCompleteCallbackFunction)(bool);
2221
void run();
2322

2423
private:
25-
2624
void OnTransmitComplete(bool);
2725
void OnReceive(int source, int dest, unsigned char* buffer, int count);
2826
void OnReady();

0 commit comments

Comments
 (0)