From de94812483b00fb77670a6f3edc3f2360a74f279 Mon Sep 17 00:00:00 2001 From: phail Date: Sun, 19 Aug 2018 21:34:55 +0200 Subject: [PATCH 1/2] debug serial can use USART2 and USART3 --- Src/comms.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/comms.c b/Src/comms.c index 6074546a..5e437a18 100644 --- a/Src/comms.c +++ b/Src/comms.c @@ -25,7 +25,7 @@ void setScopeChannel(uint8_t ch, int16_t val) { } void consoleScope() { - #if defined DEBUG_SERIAL_SERVOTERM && defined DEBUG_SERIAL_USART3 + #if defined DEBUG_SERIAL_SERVOTERM && (defined DEBUG_SERIAL_USART2 || defined DEBUG_SERIAL_USART3) uart_buf[0] = 0xff; uart_buf[1] = CLAMP(ch_buf[0]+127, 0, 255); uart_buf[2] = CLAMP(ch_buf[1]+127, 0, 255); @@ -45,7 +45,7 @@ void consoleScope() { } #endif - #if defined DEBUG_SERIAL_ASCII && defined DEBUG_SERIAL_USART3 + #if defined DEBUG_SERIAL_ASCII && (defined DEBUG_SERIAL_USART2 || defined DEBUG_SERIAL_USART3) memset(uart_buf, 0, sizeof(uart_buf)); 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]); From 1a49e2cced7b640614a224dcec60dd81d852aa36 Mon Sep 17 00:00:00 2001 From: larsm Date: Fri, 7 Sep 2018 19:53:35 +0200 Subject: [PATCH 2/2] fixed comment in battery calibration. it is serial debug channel 5, not 4. --- Inc/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Inc/config.h b/Inc/config.h index a2964f3a..f7e035fc 100644 --- a/Inc/config.h +++ b/Inc/config.h @@ -16,7 +16,7 @@ // Battery voltage calibration: connect power source. see . write value nr 5 to BAT_CALIB_ADC. make and flash firmware. then you can verify voltage on value 6 (devide it by 100.0 to get calibrated voltage). #define BAT_CALIB_REAL_VOLTAGE 43.0 // input voltage measured by multimeter -#define BAT_CALIB_ADC 1704 // adc-value measured by mainboard (value nr 4 on UART debug output) +#define BAT_CALIB_ADC 1704 // adc-value measured by mainboard (value nr 5 on UART debug output) #define BAT_NUMBER_OF_CELLS 10 // normal Hoverboard battery: 10s #define BAT_LOW_LVL1_ENABLE 0 // to beep or not to beep, 1 or 0