Skip to content

Commit

Permalink
debug console works
Browse files Browse the repository at this point in the history
  • Loading branch information
geohot committed Feb 28, 2018
1 parent bd09883 commit 8d4d763
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
4 changes: 0 additions & 4 deletions board/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,11 @@

#define USB_VID 0xbbaa

#ifdef PEDAL
#define USB_PID 0xdd00
#else
#ifdef BOOTSTUB
#define USB_PID 0xddee
#else
#define USB_PID 0xddcc
#endif
#endif

#include <stdbool.h>
#define NULL ((void*)0)
Expand Down
3 changes: 2 additions & 1 deletion board/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,10 @@ void early() {


if (enter_bootloader_mode == ENTER_BOOTLOADER_MAGIC) {
#ifdef PANDA
set_esp_mode(ESP_DISABLED);
#endif
set_led(LED_GREEN, 1);

jump_to_bootloader();
}

Expand Down
15 changes: 11 additions & 4 deletions board/pedal/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include "../config.h"

#include "drivers/drivers.h"

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

Expand Down Expand Up @@ -207,10 +206,18 @@ void pedal() {
}

int main() {
__disable_irq();

// init devices
clock_init();
periph_init();
gpio_init();

#ifdef PEDAL_USB
// enable USB
usb_init();
#endif

// pedal stuff
dac_init();
can_init(1);
Expand All @@ -219,14 +226,14 @@ int main() {
// 48mhz / 65536 ~= 732
timer_init(TIM3, 15);

puts("**** INTERRUPTS ON ****\n");
__disable_irq();

// needed?
NVIC_EnableIRQ(CAN1_TX_IRQn);
NVIC_EnableIRQ(CAN1_RX0_IRQn);
NVIC_EnableIRQ(CAN1_SCE_IRQn);

NVIC_EnableIRQ(TIM3_IRQn);

puts("**** INTERRUPTS ON ****\n");
__enable_irq();

// main pedal loop
Expand Down

0 comments on commit 8d4d763

Please sign in to comment.