6 years, 4 months ago.

Repeat a function with attach?

Hi guys! I have a problem with attach. I have to repeat a funtion, precisely I have to activate sampling if trigger is ON. I use a ticker to implement sampling.I realized a trigger software:

if((data_in>TRIG_LEVEL)&&(buffer[i-1]<TRIG_LEVEL)&&(not(start))) { start=true;

and main function:

int main() {

pc.printf("Acquisendo i dati...\n\r"); mkdir("/sd/dati_acquisiti", 0777); time_up.attach(&campiona, TC);

while (1) {

I have a problem because i cant't realize the situation in which i repeat sampling if another trigger come. I thought to do: if (trigger condition){ time_up.attach(&campiona, TC); another attach on the same ticker. Is it a correct way? Thank you for availability and I'm sorry if I didn't expressed myself well.

Be the first to answer this question.