I have read through your code, and that certainly is a lot of work! I think most of the code is fine and neat, but I still have one small question about the foreground ISR part.
In the highlighted "else" statement, if the ADC's job has not finished after 10 data are read from ADPD, then the interrupt routinue returns immediately, and the timer count will remain 0. As a result, the data read from ADPD will be refreshed to the next cycle (old data will be discarded), but the ADC conversion result will still be the old one from my understanding. If my analysis is valid, I am not sure if this will cause desychronization between the ADPD and ADC data, as they are captured in different time spot. From my understanding, both the ADPD and ADC data are processed and sent to ESP32 together in the main function, so in the ESP32 side, will it receive data from different time? Will this cause any undesirable result?
It is just my guess, and it can be, and hopefully, completely fine. Thanks again for your hardwork!
I have read through your code, and that certainly is a lot of work! I think most of the code is fine and neat, but I still have one small question about the foreground ISR part.
In the highlighted "else" statement, if the ADC's job has not finished after 10 data are read from ADPD, then the interrupt routinue returns immediately, and the timer count will remain 0. As a result, the data read from ADPD will be refreshed to the next cycle (old data will be discarded), but the ADC conversion result will still be the old one from my understanding. If my analysis is valid, I am not sure if this will cause desychronization between the ADPD and ADC data, as they are captured in different time spot. From my understanding, both the ADPD and ADC data are processed and sent to ESP32 together in the main function, so in the ESP32 side, will it receive data from different time? Will this cause any undesirable result?
It is just my guess, and it can be, and hopefully, completely fine. Thanks again for your hardwork!