Hmm, yes, that makes sense. I assume that in this case you will use
Code: Select all
rmt_set_rx_intr_en( config.channel,true);
rmt_isr_register(rmt_isr_handler, NULL, ESP_INTR_FLAG_LEVEL1, &xHandler);
Instead of:
rmt_driver_install(config.channel, 100, 0)):
By this I managed to hook the interrupt and disable the ringbuffer. But how to get the data? I tried as follows, but only the initial value was received, but it seems that I never I get data updates?
Code: Select all
rmt_isr_handle_t xHandler = NULL;
void IRAM_ATTR rmt_isr_handler(void* arg){
//read RMT interrupt status.
uint32_t intr_st = RMT.int_st.val;
rmt_config_t config;
config.channel = (rmt_channel_t) 0;
volatile rmt_item32_t* item = RMTMEM.chan[config.channel].data32;
// In the following lineI would expect to get the ticks counted, but I doesnt seem to work
// Some data is printed out, so the item seems to be exisi, but its value will never get refreshed....
if (item) Serial.print ((item)->duration0);
Serial.println();
//clear RMT interrupt status.
RMT.int_clr.val = intr_st;
}
Pls also refer to my thread for more details:
viewtopic.php?f=13&t=7646
With the Standard ISR and the ringbuffer in place I was able to get data from the items provided by the ringbuffer successfully. But then it seems to be necessary to prevent the buffer getting full by a separate task. But in my case i want to use this to get (PWM) pulses data from a radio reveiver to control a drone. So I just need the latest integer anyway.
Would be great, if anybody could help me out ...Thank you so much.....