Fix pulse output

This commit is contained in:
2025-07-20 20:44:43 -07:00
parent 5b1bc3d8bf
commit 855c5136f4

View File

@ -135,14 +135,10 @@ void HandleIntClockTick(uint32_t tick) {
break; break;
} }
const uint32_t pulse_high_ticks = CLOCK_MOD_PULSES[clock_index]; const uint16_t pulse_high_ticks = pgm_read_word_near(&CLOCK_MOD_PULSES[clock_index]);
const uint32_t pulse_low_ticks = tick + max((pulse_high_ticks / 2), 1L); const uint32_t pulse_low_ticks = tick + max((pulse_high_ticks / 2), 1L);
if (tick % pulse_high_ticks == 0) {
gravity.pulse.High();
}
if (pulse_low_ticks % pulse_high_ticks == 0) { if (pulse_low_ticks % pulse_high_ticks == 0) {
gravity.pulse.Low(); gravity.pulse.Update(!gravity.pulse.On());
} }
} }