Skip to content
Snippets Groups Projects
Commit c92f996e authored by bbartels's avatar bbartels
Browse files

quad: remove preprocessor directives in quad_app.c

parent a1f69485
No related branches found
No related tags found
No related merge requests found
......@@ -18,9 +18,6 @@
#include "communication.h"
#include "mio7_led.h"
//#define BENCH_TEST
//#define UART_BENCHMARK
int quad_main(int (*setup_hardware)(hardware_t *hardware_struct))
{
// Structures to be used throughout
......@@ -38,10 +35,8 @@ int quad_main(int (*setup_hardware)(hardware_t *hardware_struct))
return -1;
}
#ifndef BENCH_TEST
// Loops to make sure the quad is responding correctly before starting the control loop
protection_loops(&structs);
#endif
int last_kill_condition = kill_condition(&(structs.user_input_struct));
......@@ -55,23 +50,8 @@ int quad_main(int (*setup_hardware)(hardware_t *hardware_struct))
// Process all received data
#ifdef UART_BENCHMARK
usleep(500000);
u32 start_time = timer_get_count();
#endif
process_received(&structs);
#ifdef UART_BENCHMARK
u32 end_time = timer_get_count();
u32 duration = end_time - start_time;
u32 packets_processed = uart_buff_packets_processed();
u32 data[2];
data[0] = duration;
data[1] = packets_processed;
send_data(0, 0, 0, (char *) &data, 8);
#endif
#ifndef BENCH_TEST
// Get the user input and put it into user_input_struct
get_user_input(&(structs.hardware_struct), &(structs.log_struct), &(structs.user_input_struct));
......@@ -94,7 +74,7 @@ int quad_main(int (*setup_hardware)(hardware_t *hardware_struct))
}
// update the GUI
update_GUI(&(structs.log_struct));
#endif
// Processing of loop timer at the end of the control loop
timer_end_loop(&(structs.log_struct));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment