diff --git a/ArduCopter/ArduCopter.pde b/ArduCopter/ArduCopter.pde index 843d034bea..a71f252727 100644 --- a/ArduCopter/ArduCopter.pde +++ b/ArduCopter/ArduCopter.pde @@ -488,6 +488,12 @@ static const float radius_of_earth = 6378100; // meters // Used by Mavlink for unknow reasons static const float gravity = 9.81; // meters/ sec^2 +// Unions for getting byte values +union float_int{ + int32_t int_value; + float float_value; +} float_int; + //////////////////////////////////////////////////////////////////////////////// // Location & Navigation diff --git a/ArduCopter/Log.pde b/ArduCopter/Log.pde index 0a0b350168..c26a3de017 100644 --- a/ArduCopter/Log.pde +++ b/ArduCopter/Log.pde @@ -43,6 +43,19 @@ const struct Menu::command log_menu_commands[] PROGMEM = { {"disable", select_logs} }; +static int32_t get_int(float f) +{ + float_int.float_value = f; + return float_int.int_value; +} + +static float get_float(int32_t i) +{ + float_int.int_value = i; + return float_int.float_value; +} + + // A Macro to create the Menu MENU2(log_menu, "Log", log_menu_commands, print_log_menu);