Skip to content
Snippets Groups Projects
Commit 9a8459c7 authored by dawehr's avatar dawehr
Browse files

Added LOG_END message type on quadcopter and in shared commands.

parent 335d61cf
No related branches found
No related tags found
No related merge requests found
...@@ -55,6 +55,7 @@ command_cb cb_update __attribute__((weak, alias("cb_default"))); ...@@ -55,6 +55,7 @@ command_cb cb_update __attribute__((weak, alias("cb_default")));
command_cb cb_beginupdate __attribute__((weak, alias("cb_default"))); command_cb cb_beginupdate __attribute__((weak, alias("cb_default")));
command_cb cb_log __attribute__((weak, alias("cb_default"))); command_cb cb_log __attribute__((weak, alias("cb_default")));
command_cb cb_response __attribute__((weak, alias("cb_default"))); command_cb cb_response __attribute__((weak, alias("cb_default")));
command_cb cb_logend __attribute__((weak, alias("cb_default")));
/* Callbacks for configuration */ /* Callbacks for configuration */
command_cb cb_setparam __attribute__((weak, alias("cb_default"))); command_cb cb_setparam __attribute__((weak, alias("cb_default")));
...@@ -163,6 +164,15 @@ struct MessageType MessageTypes[MAX_TYPE_ID] = ...@@ -163,6 +164,15 @@ struct MessageType MessageTypes[MAX_TYPE_ID] =
floatType, floatType,
// Function pointer // Function pointer
&cb_respparam &cb_respparam
},
// LOG_END
{
// Command text
"logend",
// Type of the command data
stringType,
// Function pointer
&cb_logend
} }
}; };
......
...@@ -29,7 +29,8 @@ enum DataType ...@@ -29,7 +29,8 @@ enum DataType
* Message type IDs used to know what kind of message we are dealing with * Message type IDs used to know what kind of message we are dealing with
* Enumeration used to index the MessageTypes array in commands.c * Enumeration used to index the MessageTypes array in commands.c
* *
* DO NOT change this enum or you will break backwards compatibility. * DO NOT change items in the middle of this enum or you will break backwards compatibility.
* - Add new message types in the slot between MAX_TYPE_ID and the one before it
* DO NOT change this enum without also updating the "MessageTypes" array * DO NOT change this enum without also updating the "MessageTypes" array
* in commands.c to match. * in commands.c to match.
*/ */
...@@ -44,7 +45,8 @@ enum MessageTypeID{ ...@@ -44,7 +45,8 @@ enum MessageTypeID{
SETPARAM_ID, // 07 - Setting controller parameters. Example: PID constants SETPARAM_ID, // 07 - Setting controller parameters. Example: PID constants
GETPARAM_ID, // 08 - Getting controller parameters. Example: PID constants GETPARAM_ID, // 08 - Getting controller parameters. Example: PID constants
RESPPARAM_ID, // 09 - Responding with controller parameters. Example: PID constants RESPPARAM_ID, // 09 - Responding with controller parameters. Example: PID constants
MAX_TYPE_ID // 10 - Just used to keep track of the size LOG_END_ID, // 10 - Responding with controller parameters. Example: PID constants
MAX_TYPE_ID // 11 - Just used to keep track of the size. Must remain at the end
}; };
/* /*
......
...@@ -129,6 +129,8 @@ int main() ...@@ -129,6 +129,8 @@ int main()
printLogging(&(structs.log_struct), &(structs.parameter_struct)); printLogging(&(structs.log_struct), &(structs.parameter_struct));
resetLogging(); resetLogging();
MIO7_led_off(); MIO7_led_off();
char data[1] = {0}; // 1 byte to make compilers happy
send_data(LOG_END_ID, 0, data, 0);
} }
last_kill_condition = this_kill_condition; last_kill_condition = this_kill_condition;
......
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