Control over recursive function

Hello All, below i attached a code where i need a control on recursive function. Means, it should wait for my button press signal to move further.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

void PlaySongs::performance(int step){

step++;

if (waitForInterruptSys (iOnePin, -1) >0)
{
   cout<<"Push Button is pressed"<<endl;

   SoundNamespace::SoundProject::SoundProject project;

   project.Init();
   project.InitSound();
   
   project.StartInterruptThreads();
   project.LoadProject();
   project.AdjustSounds();
   project.LoadSounds(true);
   project.StartPlayingSounds();
   
   cout << "Initialization finished." << endl;


// Some C++ control statement NEEDS here  <--

/* here i need control, so that, after button pressed on bread board, it should move further
i.e. perform next statements, otherwise wait infinite time. something like cvWaitKey(0) from
opencv. Interrupt detected by (waitForInterruptSys (iOnePin, -1) >0). like written above. */.

if(step==3)
     return;
else
    performance(step);
 

 }
}
Last edited on
Topic archived. No new replies allowed.