just revc things

master
Firmware Batman 2017-05-16 22:15:52 -07:00
parent 43fb2ee966
commit 5409c51041
2 changed files with 16 additions and 0 deletions

View File

@ -159,11 +159,26 @@ void gpio_init() {
#endif
// K enable + L enable
#ifdef REVC
// K-line enable moved from B4->B7 to make room for GMLAN on CAN3
GPIOB->ODR |= (1 << 7);
GPIOB->MODER |= GPIO_MODER_MODER7_0;
#else
GPIOB->ODR |= (1 << 4);
GPIOB->MODER |= GPIO_MODER_MODER4_0;
#endif
GPIOA->ODR |= (1 << 14);
GPIOA->MODER |= GPIO_MODER_MODER14_0;
#ifdef REVC
// set DCP mode on the charger
/*GPIOB->ODR &= ~(1 << 2);
GPIOB->MODER |= GPIO_MODER_MODER2_0;
GPIOA->ODR &= ~(1 << 13);
GPIOA->MODER |= GPIO_MODER_MODER13_0;*/
#endif
// USART 2 for debugging
GPIOA->MODER |= GPIO_MODER_MODER2_1 | GPIO_MODER_MODER3_1;
GPIOA->AFR[0] = GPIO_AF7_USART2 << (2*4) | GPIO_AF7_USART2 << (3*4);

View File

@ -2,6 +2,7 @@
//#define DEBUG_USB
//#define CAN_LOOPBACK_MODE
//#define USE_INTERNAL_OSC
//#define REVC
#ifdef STM32F4
#define PANDA