File tree 3 files changed +13
-9
lines changed
3 files changed +13
-9
lines changed Original file line number Diff line number Diff line change 14
14
15
15
#define USB_VID 0xbbaa
16
16
17
- #ifdef PEDAL
18
- #define USB_PID 0xdd00
19
- #else
20
17
#ifdef BOOTSTUB
21
18
#define USB_PID 0xddee
22
19
#else
23
20
#define USB_PID 0xddcc
24
21
#endif
25
- #endif
26
22
27
23
#include <stdbool.h>
28
24
#define NULL ((void*)0)
Original file line number Diff line number Diff line change @@ -450,9 +450,10 @@ void early() {
450
450
451
451
452
452
if (enter_bootloader_mode == ENTER_BOOTLOADER_MAGIC ) {
453
+ #ifdef PANDA
453
454
set_esp_mode (ESP_DISABLED );
455
+ #endif
454
456
set_led (LED_GREEN , 1 );
455
-
456
457
jump_to_bootloader ();
457
458
}
458
459
Original file line number Diff line number Diff line change 7
7
#include "../config.h"
8
8
9
9
#include "drivers/drivers.h"
10
-
11
10
#include "drivers/llgpio.h"
12
11
#include "gpio.h"
13
12
@@ -207,10 +206,18 @@ void pedal() {
207
206
}
208
207
209
208
int main () {
209
+ __disable_irq ();
210
+
210
211
// init devices
211
212
clock_init ();
213
+ periph_init ();
212
214
gpio_init ();
213
215
216
+ #ifdef PEDAL_USB
217
+ // enable USB
218
+ usb_init ();
219
+ #endif
220
+
214
221
// pedal stuff
215
222
dac_init ();
216
223
can_init (1 );
@@ -219,14 +226,14 @@ int main() {
219
226
// 48mhz / 65536 ~= 732
220
227
timer_init (TIM3 , 15 );
221
228
222
- puts ("**** INTERRUPTS ON ****\n" );
223
- __disable_irq ();
224
-
229
+ // needed?
225
230
NVIC_EnableIRQ (CAN1_TX_IRQn );
226
231
NVIC_EnableIRQ (CAN1_RX0_IRQn );
227
232
NVIC_EnableIRQ (CAN1_SCE_IRQn );
228
233
229
234
NVIC_EnableIRQ (TIM3_IRQn );
235
+
236
+ puts ("**** INTERRUPTS ON ****\n" );
230
237
__enable_irq ();
231
238
232
239
// main pedal loop
You can’t perform that action at this time.
0 commit comments