How do we step out of a "lock zone"?

Discussions and support about ChibiOS/HAL, the MCU Hardware Abstraction Layer.
Post Reply
ceremcem
Posts: 66
Joined: Mon Aug 10, 2015 6:57 am
Has thanked: 7 times
Been thanked: 6 times

How do we step out of a "lock zone"?

Post by ceremcem »

I'm trying to implement a debounce logic with the following procedure:

  1. Define an input callback (button_callback) and register it when the application starts.
  2. When an interrupt is received, disable the pad event on that pad inside this interrupt handler (button_callback)
  3. Wait for a debounce time (100ms, for example)
  4. Enable the pad event
  5. Return from button_callback function.

However, this logic isn't working because documentation says:

Code: Select all

palDisablePadEvent

Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.


How can we step out of the lock zone so that we could implement this logic?
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: How do we step out of a "lock zone"?

Post by Giovanni »

Look at palDisableLineEventI().

Giovanni
Post Reply