Merge branch 'bugfix/nec_example_v4.1' into 'release/v4.1'

bugfix in NEC example and low level function  (v4.1)

See merge request espressif/esp-idf!7635
This commit is contained in:
Michael (XIAO Xufeng) 2020-02-29 02:56:12 +08:00
commit 4045dc8508
3 changed files with 7 additions and 7 deletions

View file

@ -225,21 +225,21 @@ static inline uint32_t rmt_ll_get_tx_end_interrupt_status(rmt_dev_t *dev)
{
uint32_t status = dev->int_st.val;
return ((status & 0x01) >> 0) | ((status & 0x08) >> 2) | ((status & 0x40) >> 4) | ((status & 0x200) >> 6) |
((status & 0x1000) >> 8) | ((status & 0x8000) >> 10) | ((status & 40000) >> 12) | ((status & 0x200000) >> 14);
((status & 0x1000) >> 8) | ((status & 0x8000) >> 10) | ((status & 0x40000) >> 12) | ((status & 0x200000) >> 14);
}
static inline uint32_t rmt_ll_get_rx_end_interrupt_status(rmt_dev_t *dev)
{
uint32_t status = dev->int_st.val;
return ((status & 0x02) >> 1) | ((status & 0x10) >> 3) | ((status & 0x80) >> 5) | ((status & 0x400) >> 7) |
((status & 0x2000) >> 9) | ((status & 0x10000) >> 11) | ((status & 80000) >> 13) | ((status & 0x400000) >> 15);
((status & 0x2000) >> 9) | ((status & 0x10000) >> 11) | ((status & 0x80000) >> 13) | ((status & 0x400000) >> 15);
}
static inline uint32_t rmt_ll_get_err_interrupt_status(rmt_dev_t *dev)
{
uint32_t status = dev->int_st.val;
return ((status & 0x04) >> 2) | ((status & 0x20) >> 4) | ((status & 0x100) >> 6) | ((status & 0x800) >> 8) |
((status & 0x4000) >> 10) | ((status & 0x20000) >> 12) | ((status & 100000) >> 14) | ((status & 0x800000) >> 16);
((status & 0x4000) >> 10) | ((status & 0x20000) >> 12) | ((status & 0x100000) >> 14) | ((status & 0x800000) >> 16);
}
static inline uint32_t rmt_ll_get_tx_thres_interrupt_status(rmt_dev_t *dev)

View file

@ -102,10 +102,10 @@ static esp_err_t nec_build_frame(ir_builder_t *builder, uint32_t address, uint32
if (!nec_builder->flags & IR_TOOLS_FLAGS_PROTO_EXT) {
uint8_t low_byte = address & 0xFF;
uint8_t high_byte = (address >> 8) & 0xFF;
NEC_CHECK(low_byte == ~high_byte, "address not match standard NEC protocol", err, ESP_ERR_INVALID_ARG);
NEC_CHECK(low_byte == (~high_byte & 0xFF), "address not match standard NEC protocol", err, ESP_ERR_INVALID_ARG);
low_byte = command & 0xFF;
high_byte = (command >> 8) & 0xFF;
NEC_CHECK(low_byte == ~high_byte, "command not match standard NEC protocol", err, ESP_ERR_INVALID_ARG);
NEC_CHECK(low_byte == (~high_byte & 0xFF), "command not match standard NEC protocol", err, ESP_ERR_INVALID_ARG);
}
builder->make_head(builder);
// LSB -> MSB

View file

@ -99,12 +99,12 @@ static void example_ir_tx_task(void *arg)
ESP_ERROR_CHECK(ir_builder->build_frame(ir_builder, addr, cmd));
ESP_ERROR_CHECK(ir_builder->get_result(ir_builder, &items, &length));
//To send data according to the waveform items.
rmt_write_items(example_tx_channel, items, length, true);
rmt_write_items(example_tx_channel, items, length, false);
// Send repeat code
vTaskDelay(pdMS_TO_TICKS(ir_builder->repeat_period_ms));
ESP_ERROR_CHECK(ir_builder->build_repeat_frame(ir_builder));
ESP_ERROR_CHECK(ir_builder->get_result(ir_builder, &items, &length));
rmt_write_items(example_tx_channel, items, length, true);
rmt_write_items(example_tx_channel, items, length, false);
cmd++;
}
ir_builder->del(ir_builder);