-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
56 lines (45 loc) · 1.02 KB
/
main.cpp
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/* main.cpp
*
* example using button
*
* Author: Krylov Georgii
*
* Contacts:
* https://vk.com/krylov.georgii
* https://www.facebook.com/krylov.georgii
*
*/
#include "MyRIO/ButtonIRQ.h"
#include <thread>
#include "MyRIO/button.h"
#include "MyRIO/type.h"
#include "MyRIO/pins.h"
#include "MyRIO/time.h"
#include "MyRIO/log.h"
#include "MyRIO/robot.h"
void constructor(int argc, char **argv);
NiFpga_Status distructor();
void buttonIrqThread();
void buttonIrqThread() {
robot::button::waitButtonPush();
message("exit from button");
exit(distructor());
}
int main(int argc, char **argv){
constructor(argc, argv);
robot::button::waitButtonPush();
message("start doing");
wait(1);
std::thread buttonThread(buttonIrqThread);
buttonThread.detach();
wait(5);
message("END");
return distructor();
}
void constructor(int argc, char **argv){
robot::start(argc, argv);
}
NiFpga_Status distructor(){
return robot::finish();
}