fix: update DALI double send delay and increase SPIRAM malloc reserve size
This commit fix the crash risk when bus abnormal. Signed-off-by: Tony <tonylu@tony-cloud.com>
This commit is contained in:
@@ -129,6 +129,7 @@ class DaliDomainService {
|
||||
void addRawFrameSink(std::function<void(const DaliRawFrame& frame)> sink);
|
||||
|
||||
bool resetBus(uint8_t gateway_id) const;
|
||||
bool pulseBusLow(uint8_t gateway_id, uint32_t duration_ms) const;
|
||||
bool isBusIdle(uint8_t gateway_id, uint32_t quiet_ms) const;
|
||||
void markHostActivity(uint8_t gateway_id) const;
|
||||
void markHostCommandFrame(uint8_t gateway_id, uint8_t raw_addr, uint8_t command) const;
|
||||
|
||||
@@ -305,6 +305,7 @@ std::vector<uint8_t> TransactHardwareFrame(uint8_t bus_id, const uint8_t* data,
|
||||
switch (data[0]) {
|
||||
case 0x00:
|
||||
ESP_LOGD(TAG, "received reset for bus=%u", bus_id);
|
||||
return {1};
|
||||
case 0x01:
|
||||
return {1};
|
||||
case 0x10:
|
||||
@@ -650,8 +651,11 @@ std::vector<DaliChannelInfo> DaliDomainService::channelInfo() const {
|
||||
std::vector<DaliChannelInfo> info;
|
||||
info.reserve(channels_.size());
|
||||
for (const auto& channel : channels_) {
|
||||
DaliChannelInfo item{channel->config.channel_index, channel->config.gateway_id,
|
||||
channel->phy_kind, channel->config.name};
|
||||
DaliChannelInfo item;
|
||||
item.channel_index = channel->config.channel_index;
|
||||
item.gateway_id = channel->config.gateway_id;
|
||||
item.phy_kind = channel->phy_kind;
|
||||
item.name = channel->config.name;
|
||||
if (channel->hardware_bus.has_value()) {
|
||||
item.native_bus_id = channel->hardware_bus->bus_id;
|
||||
}
|
||||
@@ -707,6 +711,15 @@ bool DaliDomainService::resetBus(uint8_t gateway_id) const {
|
||||
return channel->comm->resetBus();
|
||||
}
|
||||
|
||||
bool DaliDomainService::pulseBusLow(uint8_t gateway_id, uint32_t duration_ms) const {
|
||||
const auto* channel = findChannelByGateway(gateway_id);
|
||||
if (channel == nullptr || !channel->hardware_bus.has_value()) {
|
||||
return false;
|
||||
}
|
||||
markBusActivity(gateway_id);
|
||||
return dali_hal_pulse_bus_low(channel->hardware_bus->bus_id, duration_ms) == ESP_OK;
|
||||
}
|
||||
|
||||
bool DaliDomainService::isBusIdle(uint8_t gateway_id, uint32_t quiet_ms) const {
|
||||
TickType_t last_activity = 0;
|
||||
if (bus_activity_lock_ != nullptr) {
|
||||
|
||||
Reference in New Issue
Block a user