mirror of
https://github.com/esphome/esphome.git
synced 2024-12-25 23:14:54 +01:00
Fix ir_climate on ESP32-C3 (#2314)
Co-authored-by: Otto winter <otto@otto-winter.com>
This commit is contained in:
parent
b398d826c1
commit
5ddba719c5
2 changed files with 3 additions and 3 deletions
|
@ -14,8 +14,8 @@ RemoteRMTChannel::RemoteRMTChannel(uint8_t mem_block_num) : mem_block_num_(mem_b
|
|||
}
|
||||
|
||||
void RemoteRMTChannel::config_rmt(rmt_config_t &rmt) {
|
||||
if (rmt_channel_t(int(this->channel_) + this->mem_block_num_) > RMT_CHANNEL_7) {
|
||||
this->mem_block_num_ = int(RMT_CHANNEL_7) - int(this->channel_) + 1;
|
||||
if (rmt_channel_t(int(this->channel_) + this->mem_block_num_) >= RMT_CHANNEL_MAX) {
|
||||
this->mem_block_num_ = int(RMT_CHANNEL_MAX) - int(this->channel_);
|
||||
ESP_LOGW(TAG, "Not enough RMT memory blocks available, reduced to %i blocks.", this->mem_block_num_);
|
||||
}
|
||||
rmt.channel = this->channel_;
|
||||
|
|
|
@ -92,7 +92,7 @@ void RemoteTransmitterComponent::send_internal(uint32_t send_times, uint32_t sen
|
|||
val = this->from_microseconds(static_cast<uint32_t>(val));
|
||||
|
||||
do {
|
||||
int32_t item = std::min(val, 32767);
|
||||
int32_t item = std::min(val, int32_t(32767));
|
||||
val -= item;
|
||||
|
||||
if (rmt_i % 2 == 0) {
|
||||
|
|
Loading…
Reference in a new issue