Debugbreak #121

Merged
merged 4 commits into from Feb 16, 2013
@@ -13,6 +13,7 @@
#include "libs/SerialMessage.h"
#include "libs/StreamOutput.h"
#include "modules/robot/Player.h"
+#include "mri.h"
void SimpleShell::on_module_loaded(){
@@ -43,6 +44,8 @@ void SimpleShell::on_console_line_received( void* argument ){
this->cat_command( get_arguments(possible_command), new_message.stream );
else if (check_sum == play_command_checksum)
this->play_command(get_arguments(possible_command), new_message.stream );
+ else if (check_sum == break_command_checksum)
+ this->break_command(get_arguments(possible_command),new_message.stream );
else if (check_sum == reset_command_checksum)
this->reset_command(get_arguments(possible_command),new_message.stream );
else if (check_sum == dfu_command_checksum)
@@ -201,6 +204,12 @@ void SimpleShell::reset_command( string parameters, StreamOutput* stream){
system_reset();
}
+// Break out into the MRI debugging system
+void SimpleShell::break_command( string parameters, StreamOutput* stream){
+ stream->printf("Entering MRI debug mode...\r\n");
+ __debugbreak();
+}
+
void SimpleShell::help_command( string parameters, StreamOutput* stream ){
stream->printf("Commands:\r\n");
stream->printf("ls [folder]\r\n");
@@ -24,6 +24,7 @@
#define abort_command_checksum CHECKSUM("abort")
#define reset_command_checksum CHECKSUM("reset")
#define dfu_command_checksum CHECKSUM("dfu")
+#define break_command_checksum CHECKSUM("break")
#define help_command_checksum CHECKSUM("help")
class SimpleShell : public Module {
@@ -41,6 +42,7 @@ class SimpleShell : public Module {
void play_command( string parameters, StreamOutput* stream );
void progress_command( string parameters, StreamOutput* stream );
void abort_command( string parameters, StreamOutput* stream );
+ void break_command(string parameters, StreamOutput* stream );
void reset_command(string parameters, StreamOutput* stream );
void help_command(string parameters, StreamOutput* stream );