Thomas Buck 6 months ago
parent
commit
c1bfc51419
2 changed files with 3 additions and 2 deletions
  1. 1
    0
      src/main.c
  2. 2
    2
      src/sequence.c

+ 1
- 0
src/main.c View File

129
             uint32_t now = to_ms_since_boot(get_absolute_time());
129
             uint32_t now = to_ms_since_boot(get_absolute_time());
130
             if ((now - last) >= 250) {
130
             if ((now - last) >= 250) {
131
                 state = !state;
131
                 state = !state;
132
+                last = now;
132
                 led_set(0, state);
133
                 led_set(0, state);
133
             }
134
             }
134
         }
135
         }

+ 2
- 2
src/sequence.c View File

41
 void sequence_init(void) {
41
 void sequence_init(void) {
42
     us_per_beat = 0;
42
     us_per_beat = 0;
43
     beats = MAX_BEATS;
43
     beats = MAX_BEATS;
44
-    last_t = to_ms_since_boot(get_absolute_time());
44
+    last_t = to_us_since_boot(get_absolute_time());
45
     last_i = 0;
45
     last_i = 0;
46
     max_banks_currently = (beats + (NUM_BTNS - 1)) / NUM_BTNS;
46
     max_banks_currently = (beats + (NUM_BTNS - 1)) / NUM_BTNS;
47
 
47
 
235
             }
235
             }
236
         }
236
         }
237
 
237
 
238
-        last_t = now;
238
+        last_t += us;
239
         last_i = i;
239
         last_i = i;
240
     }
240
     }
241
 }
241
 }

Loading…
Cancel
Save