fixed and improved serial debug output

This commit is contained in:
larsm 2018-07-22 20:25:40 +02:00
parent 3d0ed7e9c0
commit a31ea1dcd1
2 changed files with 9 additions and 9 deletions

View File

@ -47,7 +47,7 @@ void consoleScope() {
#ifdef DEBUG_SERIAL_ASCII
memset(uart_buf, 0, sizeof(uart_buf));
sprintf(uart_buf, "%i;%i;%i;%i%i;%i;%i;%i\r\n", ch_buf[0], ch_buf[1], ch_buf[2], ch_buf[3], ch_buf[4], ch_buf[5], ch_buf[6], ch_buf[7]);
sprintf(uart_buf, "1:%i 2:%i 3:%i 4:%i 5:%i 6:%i 7:%i 8:%i\r\n", ch_buf[0], ch_buf[1], ch_buf[2], ch_buf[3], ch_buf[4], ch_buf[5], ch_buf[6], ch_buf[7]);
if(UART_DMA_CHANNEL->CNDTR == 0) {
UART_DMA_CHANNEL->CCR &= ~DMA_CCR_EN;

View File

@ -212,15 +212,15 @@ int main(void) {
// ####### DEBUG SERIAL OUT #######
#ifdef CONTROL_ADC
setScopeChannel(0, (int)adc_buffer.l_tx2); // ADC1
setScopeChannel(1, (int)adc_buffer.l_rx2); // ADC2
setScopeChannel(0, (int)adc_buffer.l_tx2); // 1: ADC1
setScopeChannel(1, (int)adc_buffer.l_rx2); // 2: ADC2
#endif
setScopeChannel(2, (int)speedR);
setScopeChannel(3, (int)speedL);
setScopeChannel(4, (int)adc_buffer.batt1); // for battery voltage calibration
setScopeChannel(5, (int)(batteryVoltage * 100.0f)); // for verifying battery voltage calibration
// setScopeChannel(6, (int));
// setScopeChannel(7, (int));
setScopeChannel(2, (int)speedR); // 3:
setScopeChannel(3, (int)speedL); // 4:
setScopeChannel(4, (int)adc_buffer.batt1); // 5: for battery voltage calibration
setScopeChannel(5, (int)(batteryVoltage * 100.0f)); // 6: for verifying battery voltage calibration
// setScopeChannel(6, (int)); // 7:
// setScopeChannel(7, (int)); // 8:
consoleScope();