Browse Source

fix pmw reinit and nicer gdb session settings

Thomas Buck 1 year ago
parent
commit
a7e695abb1
2 changed files with 10 additions and 4 deletions
  1. 1
    1
      firmware/debug_swd.sh
  2. 9
    3
      firmware/src/pmw3360.c

+ 1
- 1
firmware/debug_swd.sh View File

@@ -15,7 +15,7 @@ while ! netstat -tna | grep 'LISTEN\>' | grep -q ':3333\>'; do
15 15
 done
16 16
 
17 17
 echo Starting GDB
18
-arm-none-eabi-gdb -ex "target extended-remote localhost:3333" $1
18
+arm-none-eabi-gdb -ex "set history save" -ex "show print pretty" -ex "target extended-remote localhost:3333" $1
19 19
 
20 20
 echo Killing OpenOCD instance in background
21 21
 kill $OPENOCD_PID

+ 9
- 3
firmware/src/pmw3360.c View File

@@ -339,10 +339,16 @@ static void pmw_irq_stop(void) {
339 339
 }
340 340
 
341 341
 static void pmw_irq_init(void) {
342
-    // setup MOTION pin interrupt to handle reading data
343
-    gpio_add_raw_irq_handler(PMW_MOTION_PIN, pmw_motion_irq);
342
+    static bool first_init = false;
343
+
344
+    if (!first_init) {
345
+        // setup MOTION pin interrupt to handle reading data
346
+        gpio_add_raw_irq_handler(PMW_MOTION_PIN, pmw_motion_irq);
347
+        irq_set_enabled(IO_IRQ_BANK0, true);
348
+	first_init = true;
349
+    }
350
+
344 351
     pmw_irq_start();
345
-    irq_set_enabled(IO_IRQ_BANK0, true);
346 352
 
347 353
     // make MOTION pin available to picotool
348 354
     bi_decl(bi_1pin_with_name(PMW_MOTION_PIN, "PMW3360 MOTION"));

Loading…
Cancel
Save