ardupilot/libraries/Desktop/support/main.cpp

24 lines
344 B
C++
Raw Normal View History

#include <stdio.h>
2011-10-09 06:41:03 -03:00
#include <unistd.h>
#include <time.h>
#include <sys/time.h>
void setup(void);
void loop(void);
struct timeval sketch_start_time;
int main(void)
{
gettimeofday(&sketch_start_time, NULL);
setup();
2011-10-09 06:41:03 -03:00
while (true) {
2011-10-09 07:22:10 -03:00
struct timespec ts;
2011-10-09 06:41:03 -03:00
loop();
2011-10-09 07:22:10 -03:00
ts.tv_sec = 0;
ts.tv_nsec = 100;
nanosleep(&ts, NULL);
2011-10-09 06:41:03 -03:00
}
return 0;
}