most functionality to splashdwon, find neutral and start mission. short timeouts still in code for testing, will adjust to go directly to sit_idle after splashdown
Dependencies: mbed MODSERIAL FATFileSystem
Diff: GUI/Gui.cpp
- Revision:
- 74:d281aaef9766
- Parent:
- 73:f6f378311c8d
--- a/GUI/Gui.cpp Mon Jul 30 16:48:48 2018 +0000 +++ b/GUI/Gui.cpp Tue Aug 14 21:06:48 2018 +0000 @@ -61,7 +61,7 @@ //transmit full packet for (itr = full_packet.begin(); itr < full_packet.end(); itr++) { - pc().putc(*itr); //send integers over serial port one byte at a time + xbee().putc(*itr); //send integers over serial port one byte at a time } } @@ -75,8 +75,8 @@ static int command_crc_two = 0; static int command_packet_size = -1; - if (pc().readable()) { - incoming_byte = pc().getc(); + if (xbee().readable()) { + incoming_byte = xbee().getc(); switch(command_state) { case HEADER_FE: @@ -135,7 +135,7 @@ else if (incoming_byte == 12) fsm_command = TX_MBED_LOG; else if (incoming_byte == 13) - fsm_command = RECEIVE_SEQUENCE; + fsm_command = RX_SEQUENCE; else { command_state = HEADER_FE; //go back to checking the first packet } @@ -178,7 +178,7 @@ if (incoming_byte == command_crc_two) { //set state of statemachine stateMachine().setState(fsm_command); - pc().printf("CRC 1 and CRC 2 IS GOOD! fsm_command is %d\n\r", fsm_command); + xbee().printf("CRC 1 and CRC 2 IS GOOD! fsm_command is %d\n\r", fsm_command); } command_state = HEADER_FE; @@ -197,7 +197,7 @@ float depth_value = depthLoop().getPosition(); //filtered depth position float timer_value = stateMachine().getTimerValue(); - pc().printf("roll %0.2f / pitch %0.2f / heading %0.2f / depth %0.2f / timer %0.2f\n\r", roll_value, pitch_value, heading_value, depth_value, timer_value); + xbee().printf("roll %0.2f / pitch %0.2f / heading %0.2f / depth %0.2f / timer %0.2f\n\r", roll_value, pitch_value, heading_value, depth_value, timer_value); vector <int> gui_update_packet; @@ -209,7 +209,7 @@ const unsigned char * ptr_heading_value = reinterpret_cast<const unsigned char*>(&heading_value); const unsigned char * ptr_depth_value = reinterpret_cast<const unsigned char*>(&depth_value); const unsigned char * ptr_timer_value = reinterpret_cast<const unsigned char*>(&timer_value); - //pc().printf("DEBUG: timer_value is %f or HEX: %x %x %x %x\n\r",timer_value,ptr_timer_value[3],ptr_timer_value[2],ptr_timer_value[1],ptr_timer_value[0]); + //xbee().printf("DEBUG: timer_value is %f or HEX: %x %x %x %x\n\r",timer_value,ptr_timer_value[3],ptr_timer_value[2],ptr_timer_value[1],ptr_timer_value[0]); // BE AD GUI GUI LENGTH DATA DATA CC CC