mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-23 10:46:31 +00:00
Fix for CmndHDMIAddr function. (#19866)
* Fix for CmndHDMIAddr function. 1. Typical values for XdrvMailbox.payload are 0x1000...0x4000. Hence the check should be (value > 0). 2. Don't overwrite the user supplied value with value read from the hardware. * Correct the condition in CEC_Device::OnReady. We should check for _on_ready_cb before calling _on_ready_cb.
This commit is contained in:
parent
b034e5bb93
commit
be94a6cac8
@ -1116,7 +1116,7 @@ bool IRAM_ATTR CEC_Device::setLineState(bool state, bool check)
|
||||
// manage callbacks
|
||||
void CEC_Device::OnReady(int logical_address)
|
||||
{
|
||||
if (_on_rx_cb) { _on_ready_cb(this, logical_address); }
|
||||
if (_on_ready_cb) { _on_ready_cb(this, logical_address); }
|
||||
|
||||
// This is called after the logical address has been allocated
|
||||
int physical_address = getPhysicalAddress();
|
||||
|
@ -284,13 +284,13 @@ uint16_t HDMIGetPhysicalAddress(void) {
|
||||
|
||||
void CmndHDMIAddr(void) {
|
||||
if (XdrvMailbox.data_len > 0) {
|
||||
if ((XdrvMailbox.payload < 1)) {
|
||||
if ((XdrvMailbox.payload > 0)) {
|
||||
uint16_t hdmi_addr = XdrvMailbox.payload;
|
||||
Settings->hdmi_addr[0] = (hdmi_addr) & 0xFF;
|
||||
Settings->hdmi_addr[1] = (hdmi_addr >> 8) & 0xFF;
|
||||
}
|
||||
}
|
||||
uint16_t hdmi_addr = HDMIGetPhysicalAddress();
|
||||
uint16_t hdmi_addr = HDMI_CEC_device->discoverPhysicalAddress();
|
||||
Response_P(PSTR("{\"%s\":\"0x%04X\"}"), XdrvMailbox.command, hdmi_addr);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user