Skip to content

Commit 8d4d763

Browse files
committed
debug console works
1 parent bd09883 commit 8d4d763

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

board/config.h

-4
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,11 @@
1414

1515
#define USB_VID 0xbbaa
1616

17-
#ifdef PEDAL
18-
#define USB_PID 0xdd00
19-
#else
2017
#ifdef BOOTSTUB
2118
#define USB_PID 0xddee
2219
#else
2320
#define USB_PID 0xddcc
2421
#endif
25-
#endif
2622

2723
#include <stdbool.h>
2824
#define NULL ((void*)0)

board/gpio.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -450,9 +450,10 @@ void early() {
450450

451451

452452
if (enter_bootloader_mode == ENTER_BOOTLOADER_MAGIC) {
453+
#ifdef PANDA
453454
set_esp_mode(ESP_DISABLED);
455+
#endif
454456
set_led(LED_GREEN, 1);
455-
456457
jump_to_bootloader();
457458
}
458459

board/pedal/main.c

+11-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#include "../config.h"
88

99
#include "drivers/drivers.h"
10-
1110
#include "drivers/llgpio.h"
1211
#include "gpio.h"
1312

@@ -207,10 +206,18 @@ void pedal() {
207206
}
208207

209208
int main() {
209+
__disable_irq();
210+
210211
// init devices
211212
clock_init();
213+
periph_init();
212214
gpio_init();
213215

216+
#ifdef PEDAL_USB
217+
// enable USB
218+
usb_init();
219+
#endif
220+
214221
// pedal stuff
215222
dac_init();
216223
can_init(1);
@@ -219,14 +226,14 @@ int main() {
219226
// 48mhz / 65536 ~= 732
220227
timer_init(TIM3, 15);
221228

222-
puts("**** INTERRUPTS ON ****\n");
223-
__disable_irq();
224-
229+
// needed?
225230
NVIC_EnableIRQ(CAN1_TX_IRQn);
226231
NVIC_EnableIRQ(CAN1_RX0_IRQn);
227232
NVIC_EnableIRQ(CAN1_SCE_IRQn);
228233

229234
NVIC_EnableIRQ(TIM3_IRQn);
235+
236+
puts("**** INTERRUPTS ON ****\n");
230237
__enable_irq();
231238

232239
// main pedal loop

0 commit comments

Comments
 (0)