Skip to content
  • Dave Hylands's avatar
    stmhal: Fix timer capture/compare interrupt handling for TIM1 and TIM8. · c6983e3c
    Dave Hylands authored
    It turns out that TIM1 and TIM8 have their own Capture/Compare
    interrupt vector. For all of the other timers, the capture/compare
    interrupt vector is the same as the update vector.
    So we need to add handlers for these vectors and enable them
    when using capture/compare callbacks.
    During testing of this, I also found that passing a channel callback
    into the channel constructor would not enable interrupts properly.
    I tested using:
    >>> pyb.Timer(1, freq=4).channel(1, pyb.Timer.OC_TOGGLE, callback=lambda t: print('.', end=''))
    I tested the above with channels 1, 4, and 8