Skip to content

Commit

Permalink
remove nested includes and include guards
Browse files Browse the repository at this point in the history
  • Loading branch information
geohot committed May 23, 2019
1 parent 3810452 commit 5069005
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 26 deletions.
7 changes: 0 additions & 7 deletions board/drivers/can.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#ifndef PANDA_CAN_H
#define PANDA_CAN_H

// IRQs: CAN1_TX, CAN1_RX0, CAN1_SCE
// CAN2_TX, CAN2_RX0, CAN2_SCE
// CAN3_TX, CAN3_RX0, CAN3_SCE
Expand Down Expand Up @@ -36,8 +33,6 @@ int can_pop(can_ring *q, CAN_FIFOMailBox_TypeDef *elem);
#define ALL_CAN_BUT_MAIN_SILENT 0xFE
#define ALL_CAN_LIVE 0

#include "llcan.h"

int can_live = 0, pending_can_live = 0, can_loopback = 0, can_silent = ALL_CAN_SILENT;

// ********************* instantiate queues *********************
Expand Down Expand Up @@ -433,5 +428,3 @@ void can_set_forwarding(int from, int to) {
can_forwarding[from] = to;
}

#endif

3 changes: 0 additions & 3 deletions board/drivers/gmlan_alt.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@ int get_bit_message(char *out, CAN_FIFOMailBox_TypeDef *to_bang) {
return len;
}

#ifdef PANDA

void setup_timer4() {
// setup
TIM4->PSC = 48-1; // tick on 1 us
Expand Down Expand Up @@ -273,4 +271,3 @@ void bitbang_gmlan(CAN_FIFOMailBox_TypeDef *to_bang) {
setup_timer4();
}

#endif
5 changes: 0 additions & 5 deletions board/drivers/llgpio.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#ifndef PANDA_LLGPIO_H
#define PANDA_LLGPIO_H

#define MODE_INPUT 0
#define MODE_OUTPUT 1
#define MODE_ALTERNATE 2
Expand Down Expand Up @@ -45,5 +42,3 @@ int get_gpio_input(GPIO_TypeDef *GPIO, int pin) {
return (GPIO->IDR & (1 << pin)) == (1 << pin);
}

#endif

5 changes: 0 additions & 5 deletions board/drivers/spi.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#ifndef PANDA_SPI_H
#define PANDA_SPI_H

// IRQs: DMA2_Stream2, DMA2_Stream3, EXTI4

void spi_init();
Expand Down Expand Up @@ -128,5 +125,3 @@ void EXTI4_IRQHandler(void) {
EXTI->PR = pr;
}

#endif

6 changes: 0 additions & 6 deletions board/drivers/usb.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#ifndef PANDA_USB_H
#define PANDA_USB_H

// IRQs: OTG_FS

typedef union {
Expand Down Expand Up @@ -1024,6 +1021,3 @@ void OTG_FS_IRQHandler(void) {
NVIC_EnableIRQ(OTG_FS_IRQn);
}

#endif


2 changes: 2 additions & 0 deletions board/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@

// ********************* includes *********************


#include "libc.h"
#include "safety.h"
#include "provision.h"

#include "drivers/llcan.h"
#include "drivers/llgpio.h"
#include "gpio.h"

Expand Down

0 comments on commit 5069005

Please sign in to comment.