summaryrefslogtreecommitdiff
path: root/digital/beacon/src/debug_avr.c
diff options
context:
space:
mode:
Diffstat (limited to 'digital/beacon/src/debug_avr.c')
-rw-r--r--digital/beacon/src/debug_avr.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/digital/beacon/src/debug_avr.c b/digital/beacon/src/debug_avr.c
index b195a4f2..1b0e0dfb 100644
--- a/digital/beacon/src/debug_avr.c
+++ b/digital/beacon/src/debug_avr.c
@@ -34,10 +34,10 @@
#include "network.h"
#include "motor.h"
#include "misc.h"
+#include "position.h"
HAL_UsartDescriptor_t appUsartDescriptor; // USART descriptor (required by stack)
HAL_AppTimer_t debugTimer; // TIMER descripor used by the DEBUG task
-HAL_AppTimer_t wheelTimer; // TIMER descripor used by the DEBUG task
uint8_t usartRxBuffer[APP_USART_RX_BUFFER_SIZE]; // USART Rx buffer
uint8_t usartTxBuffer[APP_USART_TX_BUFFER_SIZE]; // USART Tx buffer
@@ -127,7 +127,7 @@ void usartRXCallback(uint16_t bytesToRead)
calibration_start_stop_task();
break;
case 'q':
- calibration_set_laser_flag(SET);
+// calibration_set_laser_flag(SET);
break;
case 'r':
reset_avr();
@@ -138,9 +138,21 @@ void usartRXCallback(uint16_t bytesToRead)
case 'j':
jack_on_off();
break;
+ case '0':
+ network_send_data(NETWORK_RESET,0x1);
+ break;
+ case 'w':
+ OCR0A--;
+ uprintf("OCR0A = %d\r\n",OCR0A);
+ break;
+ case 'x':
+ OCR0A++;
+ uprintf("OCR0A = %d\r\n",OCR0A);
+ break;
/* Default */
default :
uprintf(" ?? Unknown command ??\r\n");
+ break;
}
}
@@ -197,15 +209,19 @@ void debug_task(void)
uprintf("Status : 0x%x - ",network_get_status());
uprintf("LQI = %d - ",network_get_lqi());
uprintf("RSSI = %d - \r\n",network_get_rssi());
-#ifdef TYPE_END
+#ifdef TYPE_COOR
+ uprintf("X = %d --- ",position_get_coord(OPPONENT_1,X));
+ uprintf("Y = %d --- ",position_get_coord(OPPONENT_1,Y));
+ uprintf("Trust = %d\r\n",position_get_trust(OPPONENT_1));
+#else
+ uprintf("## Calibration\r\n");
+ uprintf("State : %d\r\n",calibration_get_state());
uprintf("## Servo\r\n");
uprintf("State : [1]=%d [2]=%d - ",servo_get_state(SERVO_1),servo_get_state(SERVO_2));
uprintf("Value : [1]=%d [2]=%d\r\n",servo_get_value(SERVO_1),servo_get_value(SERVO_2));
uprintf("## Codewheel\r\n");
- uprintf("Raw = %d - Degree = %f\r\n",codewheel_get_value(),codewheel_convert_angle_raw2degrees(codewheel_get_value()));
- uprintf("## Calibration\r\n");
- uprintf("State : %d\r\n",calibration_get_state());
- uprintf("## Calibration\r\n");
- uprintf("State : %d\r\n",motor_get_state());
+ uprintf("State = %d - Raw = %d - Degree = %f\r\n",codewheel_get_state(),codewheel_get_value(),codewheel_convert_angle_raw2degrees(codewheel_get_value()));
+ uprintf("## Motor\r\n");
+ uprintf("State : %d ---- speed = %d\r\n",motor_get_state(),OCR0A);
#endif
}