and fixed a UART noise bug

This commit is contained in:
Firmware Batman 2017-07-29 19:50:35 -07:00
parent 1066c2d1b0
commit 9e2d49e225
3 changed files with 6 additions and 6 deletions

View File

@ -23,7 +23,6 @@
#include "drivers/usb.h"
//#include "drivers/uart.h"
void uart_init(USART_TypeDef *u, int baud) {}
int puts(const char *a) { return 0; }
void puth(unsigned int i) {}

View File

@ -431,8 +431,12 @@ int main() {
puts(is_entering_bootmode ? " ESP wants bootmode\n" : " no bootmode\n");
gpio_init();
// enable main uart
uart_init(USART2, 115200);
// enable main uart if it's connected
if (has_external_debug_serial) {
// WEIRDNESS: without this gate around the UART, it would "crash", but only if the ESP is enabled
// assuming it's because the lines were left floating and spurious noise was on them
uart_init(USART2, 115200);
}
#ifdef PANDA
// enable ESP uart

View File

@ -140,9 +140,6 @@ void soft_flasher_start() {
set_gpio_alternate(GPIOA, 12, GPIO_AF10_OTG_FS);
GPIOA->OSPEEDR = GPIO_OSPEEDER_OSPEEDR11 | GPIO_OSPEEDER_OSPEEDR12;
// enable main uart
uart_init(USART2, 115200);
// flasher
spi_init();