Skip to content

Commit

Permalink
[multithreading] kill unnessesary program on bebop
Browse files Browse the repository at this point in the history
  • Loading branch information
kirkscheper committed Jun 27, 2018
1 parent ac76b90 commit ed6a8b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions sw/airborne/boards/bebop/board.c
Expand Up @@ -121,6 +121,9 @@ void board_init(void)
int ret __attribute__((unused)) = system("killall -q -15 DragonStarter.sh");
usleep(50000); /* Give DragonStarter 50ms time to end on a busy system */
kill_gracefull("dragon-prog");
#if PRIMARY_GPS == GPS_DATALINK
kill_gracefull("ephemerisd");
#endif
}

void board_init2(void)
Expand Down
6 changes: 4 additions & 2 deletions sw/airborne/firmwares/rotorcraft/main.c
Expand Up @@ -36,6 +36,8 @@

#include "mcu_periph/sys_time.h"

#define POLLING_PERIOD (500000/PERIODIC_FREQUENCY)
#include <stdio.h>
#ifndef SITL
int main(void)
{
Expand All @@ -58,8 +60,8 @@ int main(void)

/* sleep remaining time to limit to 1kHz */
t_diff = get_sys_time_usec() - t_begin;
if (t_diff < 1000) {
sys_time_usleep(1000 - t_diff);
if (t_diff < POLLING_PERIOD) {
sys_time_usleep(POLLING_PERIOD - t_diff);
}
}
#else
Expand Down

0 comments on commit ed6a8b4

Please sign in to comment.