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

Discussions and support about ChibiOS/HAL, the MCU Hardware Abstraction Layer.
Posts: 67
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"?

Postby ceremcem » Tue Jun 25, 2019 1:31 pm

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


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
Site Admin
Posts: 13213
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 787 times
Been thanked: 681 times

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

Postby Giovanni » Tue Jun 25, 2019 5:20 pm

Look at palDisableLineEventI().


Return to “ChibiOS/HAL”

Who is online

Users browsing this forum: No registered users and 3 guests